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;
         }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to