qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fix:readcapacity 10 failure shown even 16 sent
@ 2015-12-10  2:59 Zhu Lingshan
  2015-12-10  8:55 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Zhu Lingshan @ 2015-12-10  2:59 UTC (permalink / raw)
  To: qemu-block, qemu-devel; +Cc: pbonzini, pl, Zhu Lingshan, ronniesahlberg

This Patch would fix a bug that readcapacity10
failuare would be shown no matter readcapacy10
or readcapacity16 actually sent.

Signed-off-by: Zhu Lingshan <lszhu@suse.com>
---
 block/iscsi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index bd1f1bf..6425cf4 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1269,7 +1269,10 @@ static void iscsi_readcapacity_sync(IscsiLun *iscsilun, Error **errp)
              && task->sense.key == SCSI_SENSE_UNIT_ATTENTION
              && retries-- > 0);
 
-    if (task == NULL || task->status != SCSI_STATUS_GOOD) {
+    if ((rc16 != NULL) && ((task == NULL) || (task->status != SCSI_STATUS_GOOD))) {
+        error_setg(errp, "iSCSI: failed to send readcapacity16 command.");
+    }
+    if ((rc10 != NULL) && ((task == NULL) || (task->status != SCSI_STATUS_GOOD))) {
         error_setg(errp, "iSCSI: failed to send readcapacity10 command.");
     } else if (!iscsilun->block_size ||
                iscsilun->block_size % BDRV_SECTOR_SIZE) {
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-10  9:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-10  2:59 [Qemu-devel] [PATCH] fix:readcapacity 10 failure shown even 16 sent Zhu Lingshan
2015-12-10  8:55 ` Paolo Bonzini
2015-12-10  8:57   ` Peter Lieven
2015-12-10  9:08     ` Zhu Lingshan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).