Index: usr.sbin/bhyve/block_if.c =================================================================== --- usr.sbin/bhyve/block_if.c (revision 286768) +++ usr.sbin/bhyve/block_if.c (working copy) @@ -392,6 +392,7 @@ { char tname[MAXCOMLEN + 1]; char name[MAXPATHLEN]; + char errstr[MAXPATHLEN+64]; /* allow error text to be 64 chars long */ char *nopt, *xopts, *cp; struct blockif_ctxt *bc; struct stat sbuf; @@ -447,12 +448,14 @@ } if (fd < 0) { - perror("Could not open backing file"); + snprintf(errstr, sizeof(errstr), "Could not open backing file: %s", nopt); + perror(errstr); goto err; } if (fstat(fd, &sbuf) < 0) { - perror("Could not stat backing file"); + snprintf(errstr, sizeof(errstr), "Could not stat backing file: %s", nopt); + perror(errstr); goto err; } Index: usr.sbin/bhyve/pci_virtio_block.c =================================================================== --- usr.sbin/bhyve/pci_virtio_block.c (revision 286768) +++ usr.sbin/bhyve/pci_virtio_block.c (working copy) @@ -296,6 +296,7 @@ struct pci_vtblk_softc *sc; off_t size; int i, sectsz, sts, sto; + char errstr[MAXPATHLEN+64]; /* allow error text to be 64 chars long */ if (opts == NULL) { printf("virtio-block: backing device required\n"); @@ -308,7 +309,8 @@ snprintf(bident, sizeof(bident), "%d:%d", pi->pi_slot, pi->pi_func); bctxt = blockif_open(opts, bident); if (bctxt == NULL) { - perror("Could not open backing file"); + snprintf(errstr, sizeof(errstr), "Could not open backing file: %s", opts); + perror(errstr); return (1); }