scsi: Improve error messages more
Quoted 8 lines · Paolo Bonzini
Remove the "scsi-block:" prefix for error messages as suggested by Markus.
Improve the previous patch by making the message the same for both scsi-block and scsi-generic, including the
strerror()output in both and making an explicit reference toSG_IO. Also s/can not/cannot/.Signed-off-by Paolo Bonzini <[email protected]>
Paolo, I think there are a small number of scsi-next patches queued now, are you going to send a PULL request?
Thanks,
Fam
Quoted 72 lines
--- hw/scsi/scsi-disk.c | 11 ++++++----- hw/scsi/scsi-generic.c | 8 ++++++-- 2 files changed, 12 insertions(+), 7 deletions(-)hw/scsi/scsi-disk.c +6
-5@@ -2458,26 +2458,27 @@ static int scsi_block_initfn(SCSIDevice *dev)int rc;if (!s->qdev.conf.bs) { -error_report ("scsi-block: drive property not set" ); +error_report ("drive property not set" );return -1 ; }/* check we are using a driver managing SG_IO (version 3 and after) */ - rc =bdrv_ioctl (s->qdev.conf.bs,SG_GET_VERSION_NUM , &sg_version); + rc =bdrv_ioctl (s->qdev.conf.bs,SG_GET_VERSION_NUM , &sg_version);if (rc <0 ) { -error_report ("scsi-block: can not get version number: %s" , +error_report ("cannot get SG_IO version number: %s. " +"Is this a SCSI device?" ,strerror (-rc));return -1 ; }if (sg_version <30000 ) { -error_report ("scsi-block: scsi generic interface too old" ); +error_report ("scsi generic interface too old" );return -1 ; }/* get device type from INQUIRY data */ rc =get_device_type (s);if (rc <0 ) { -error_report ("scsi-block: INQUIRY failed" ); +error_report ("INQUIRY failed" );return -1 ; }hw/scsi/scsi-generic.c +6
-2@@ -394,6 +394,7 @@ static void scsi_destroy(SCSIDevice *s)static int scsi_generic_initfn (SCSIDevice *s) { +int rc;int sg_version;struct sg_scsi_id scsiid;@@ -412,8 +413,11 @@ static int scsi_generic_initfn(SCSIDevice *s) }/* check we are using a driver managing SG_IO (version 3 and after */ -if (bdrv_ioctl (s->conf.bs,SG_GET_VERSION_NUM , &sg_version) <0 ) { -error_report ("scsi generic interface not supported" ); + rc =bdrv_ioctl (s->conf.bs,SG_GET_VERSION_NUM , &sg_version); +if (rc <0 ) { +error_report ("cannot get SG_IO version number: %s. " +"Is this a SCSI device?" , +strerror (-rc));return -1 ; }if (sg_version <30000 ) {Signature · 1 line
1.8.3.1
Il 16/05/2014 09:33, Fam Zheng ha scritto:
Quoted 12 lines · Paolo Bonzini
Quoted 8 lines
Remove the "scsi-block:" prefix for error messages as suggested by Markus.
Improve the previous patch by making the message the same for both scsi-block and scsi-generic, including the
strerror()output in both and making an explicit reference toSG_IO. Also s/can not/cannot/.Signed-off-by Paolo Bonzini <[email protected]>Paolo, I think there are a small number of scsi-next patches queued now, are you going to send a PULL request?
Yes.
Paolo
Quoted 9 lines · Paolo Bonzini
Il 16/05/2014 09:33, Fam Zheng ha scritto:
Quoted 8 lines · Paolo Bonzini
Quoted 7 lines
Remove the "scsi-block:" prefix for error messages as suggested by Markus.
Improve the previous patch by making the message the same for both scsi-block and scsi-generic, including the
strerror()output in both and making an explicit reference toSG_IO. Also s/can not/cannot/.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Paolo Bonzini <[email protected]>Paolo, I think there are a small number of scsi-next patches queued now, are you going to send a PULL request?
Yes.
Good, thanks!
Fam