FreeBSD Bugzilla – Attachment 159856 Details for
Bug 202321
[bhyve,patch] More verbose error reporting in bhyve for backing images
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
more verbose errors when loading a backing file
file_202321.txt (text/plain), 1.89 KB, created by
Willem Jan Withagen
on 2015-08-14 13:01:09 UTC
(
hide
)
Description:
more verbose errors when loading a backing file
Filename:
MIME Type:
Creator:
Willem Jan Withagen
Created:
2015-08-14 13:01:09 UTC
Size:
1.89 KB
patch
obsolete
>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); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 202321
: 159856