qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH] fix:readcapacity 10 failure shown even 16 sent


From: Zhu Lingshan
Subject: [Qemu-block] [PATCH] fix:readcapacity 10 failure shown even 16 sent
Date: Thu, 10 Dec 2015 10:59:46 +0800

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

Signed-off-by: Zhu Lingshan <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]