scsi-disk: Improve error messager if can't get version number
More often it is that bdrv_ioctl fails due to not supported by driver or whatever reason, in this case we should be specific, because "interface too old" is very confusing. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
411f491e0a
commit
4bbeb8b173
|
@ -2463,8 +2463,13 @@ static int scsi_block_initfn(SCSIDevice *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check we are using a driver managing SG_IO (version 3 and after) */
|
/* check we are using a driver managing SG_IO (version 3 and after) */
|
||||||
if (bdrv_ioctl(s->qdev.conf.bs, SG_GET_VERSION_NUM, &sg_version) < 0 ||
|
rc = bdrv_ioctl(s->qdev.conf.bs, SG_GET_VERSION_NUM, &sg_version);
|
||||||
sg_version < 30000) {
|
if (rc < 0) {
|
||||||
|
error_report("scsi-block: can not get version number: %s",
|
||||||
|
strerror(-rc));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (sg_version < 30000) {
|
||||||
error_report("scsi-block: scsi generic interface too old");
|
error_report("scsi-block: scsi generic interface too old");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue