提交 21141549 编写于 作者: J John Ferlan

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.
上级 9e030093
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册