From: Zhu Lingshan <lszhu@suse.com>
To: qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, pl@kamp.de, Zhu Lingshan <lszhu@suse.com>,
ronniesahlberg@gmail.com
Subject: [Qemu-devel] [PATCH] fix:readcapacity 10 failure shown even 16 sent
Date: Thu, 10 Dec 2015 10:59:46 +0800 [thread overview]
Message-ID: <1449716386-5652-1-git-send-email-lszhu@suse.com> (raw)
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
next reply other threads:[~2015-12-10 3:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 2:59 Zhu Lingshan [this message]
2015-12-10 8:55 ` [Qemu-devel] [PATCH] fix:readcapacity 10 failure shown even 16 sent Paolo Bonzini
2015-12-10 8:57 ` Peter Lieven
2015-12-10 9:08 ` Zhu Lingshan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1449716386-5652-1-git-send-email-lszhu@suse.com \
--to=lszhu@suse.com \
--cc=pbonzini@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=ronniesahlberg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).