View | Details | Raw Unified | Return to bug 202321
Collapse All | Expand All

(-)usr.sbin/bhyve/block_if.c (working copy) (-2 / +5 lines)
Lines 392-397 Link Here
392
{
392
{
393
       char tname[MAXCOMLEN + 1];
393
       char tname[MAXCOMLEN + 1];
394
       char name[MAXPATHLEN];
394
       char name[MAXPATHLEN];
395
       char errstr[MAXPATHLEN+64];     /* allow error text to be 64 chars long */
395
       char *nopt, *xopts, *cp;
396
       char *nopt, *xopts, *cp;
396
       struct blockif_ctxt *bc;
397
       struct blockif_ctxt *bc;
397
       struct stat sbuf;
398
       struct stat sbuf;
Lines 447-458 Link Here
447
       }
448
       }
448
       if (fd < 0) {
449
       if (fd < 0) {
449
               perror("Could not open backing file");
450
               snprintf(errstr, sizeof(errstr), "Could not open backing file: %s", nopt);
451
               perror(errstr);
450
               goto err;
452
               goto err;
451
       }
453
       }
452
        if (fstat(fd, &sbuf) < 0) {
454
        if (fstat(fd, &sbuf) < 0) {
453
                perror("Could not stat backing file");
455
               snprintf(errstr, sizeof(errstr), "Could not stat backing file: %s", nopt);
456
               perror(errstr);
454
               goto err;
457
               goto err;
455
        }
458
        }
(-)usr.sbin/bhyve/pci_virtio_block.c (working copy) (-1 / +3 lines)
Lines 296-301 Link Here
296
       struct pci_vtblk_softc *sc;
296
       struct pci_vtblk_softc *sc;
297
       off_t size;
297
       off_t size;
298
       int i, sectsz, sts, sto;
298
       int i, sectsz, sts, sto;
299
       char errstr[MAXPATHLEN+64];     /* allow error text to be 64 chars long */
299
       if (opts == NULL) {
300
       if (opts == NULL) {
300
               printf("virtio-block: backing device required\n");
301
               printf("virtio-block: backing device required\n");
Lines 308-314 Link Here
308
       snprintf(bident, sizeof(bident), "%d:%d", pi->pi_slot, pi->pi_func);
309
       snprintf(bident, sizeof(bident), "%d:%d", pi->pi_slot, pi->pi_func);
309
       bctxt = blockif_open(opts, bident);
310
       bctxt = blockif_open(opts, bident);
310
       if (bctxt == NULL) {
311
       if (bctxt == NULL) {
311
               perror("Could not open backing file");
312
               snprintf(errstr, sizeof(errstr), "Could not open backing file: %s", opts);
313
               perror(errstr);
312
               return (1);
314
               return (1);
313
       }
315
       }

Return to bug 202321