From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Fam Zheng <famz@redhat.com>
Subject: [Qemu-devel] [PULL 01/11] scsi-disk: Improve error messager if can't get version number
Date: Fri, 16 May 2014 12:37:34 +0200 [thread overview]
Message-ID: <1400236664-32334-2-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1400236664-32334-1-git-send-email-pbonzini@redhat.com>
From: Fam Zheng <famz@redhat.com>
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>
---
hw/scsi/scsi-disk.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 48a28ae..d2e532e 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2463,8 +2463,13 @@ static int scsi_block_initfn(SCSIDevice *dev)
}
/* 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 ||
- sg_version < 30000) {
+ 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",
+ strerror(-rc));
+ return -1;
+ }
+ if (sg_version < 30000) {
error_report("scsi-block: scsi generic interface too old");
return -1;
}
--
1.8.3.1
next prev parent reply other threads:[~2014-05-16 10:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-16 10:37 [Qemu-devel] [PULL 00/11] SCSI changes for 2014-05-15 Paolo Bonzini
2014-05-16 10:37 ` Paolo Bonzini [this message]
2014-05-16 10:37 ` [Qemu-devel] [PULL 02/11] scsi: Improve error messages more Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 03/11] megasas: Implement LD_LIST_QUERY Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 04/11] megasas: Enable MSI-X support Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 05/11] megasas: Add MSI support Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 06/11] MAINTAINERS: mark megasas as maintained Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 07/11] block/iscsi: allow fall back to WRITE SAME without UNMAP Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 08/11] block/iscsi: speed up read for unallocated sectors Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 09/11] block/iscsi: clarify the meaning of ISCSI_CHECKALLOC_THRES Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 10/11] block/iscsi: allow cluster_size of 4K and greater Paolo Bonzini
2014-05-16 10:37 ` [Qemu-devel] [PULL 11/11] [PATCH] block/iscsi: bump year in copyright notice Paolo Bonzini
2014-05-19 11:52 ` [Qemu-devel] [PULL 00/11] SCSI changes for 2014-05-15 Peter Maydell
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=1400236664-32334-2-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).