Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 May 2016 11:46:54 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300843 - head/usr.sbin/bhyve
Message-ID:  <201605271146.u4RBkspo045212@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Fri May 27 11:46:54 2016
New Revision: 300843
URL: https://svnweb.freebsd.org/changeset/base/300843

Log:
  Improve error message when failing to open a backing file
  
  When bhyve cannot open a backing file, it now says explicitly which file
  could not be opened
  
  Note that the change has only be maed in block_if.c and not in
  pci_virtio_block.c as the error will always be catched by the first
  
  PR:		202321 (different patch)
  Reviewed by:	grehan
  MFC after:	3 day
  Sponsored by:	Gandi.net
  Differential Revision:	https://reviews.freebsd.org/D6576

Modified:
  head/usr.sbin/bhyve/block_if.c

Modified: head/usr.sbin/bhyve/block_if.c
==============================================================================
--- head/usr.sbin/bhyve/block_if.c	Fri May 27 11:46:35 2016	(r300842)
+++ head/usr.sbin/bhyve/block_if.c	Fri May 27 11:46:54 2016	(r300843)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/disk.h>
 
 #include <assert.h>
+#include <err.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -447,12 +448,12 @@ blockif_open(const char *optstr, const c
 	}
 
 	if (fd < 0) {
-		perror("Could not open backing file");
+		warn("Could not open backing file: %s", nopt);
 		goto err;
 	}
 
         if (fstat(fd, &sbuf) < 0) {
-                perror("Could not stat backing file");
+		warn("Could not stat backing file %s", nopt);
 		goto err;
         }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605271146.u4RBkspo045212>