From: John Ferlan Date: Tue, 12 Dec 2017 13:31:03 +0000 (-0500) Subject: util: Report error if vhost-scsi device file cannot be found X-Git-Tag: v4.0.0-rc1~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=211415492266084e9652615de07eb1527878e2c2;p=thirdparty%2Flibvirt.git util: Report error if vhost-scsi device file cannot be found https://bugzilla.redhat.com/show_bug.cgi?id=1523564 If the vhost-scsi device file cannot be found, the generic error "error: An error occurred, but the cause is unknown" is returned. Let's add a real error message to make it clear why the failure occurred. --- diff --git a/src/util/virscsivhost.c b/src/util/virscsivhost.c index d6fbf5ed5b..5f176e177f 100644 --- a/src/util/virscsivhost.c +++ b/src/util/virscsivhost.c @@ -86,8 +86,12 @@ VIR_ONCE_GLOBAL_INIT(virSCSIVHost) int virSCSIVHostOpenVhostSCSI(int *vhostfd) { - if (!virFileExists(VHOST_SCSI_DEVICE)) + if (!virFileExists(VHOST_SCSI_DEVICE)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("vhost-scsi device file '%s' cannot be found"), + VHOST_SCSI_DEVICE); return -1; + } *vhostfd = open(VHOST_SCSI_DEVICE, O_RDWR);