From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: pbonzini@redhat.com, famz@redhat.com
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/3] virtio-scsi: dataplane: print why starting failed
Date: Wed, 15 Oct 2014 15:15:24 +0200 [thread overview]
Message-ID: <1413378926-52442-2-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1413378926-52442-1-git-send-email-cornelia.huck@de.ibm.com>
Setting up guest or host notifiers may fail, but the user will have
no idea why: Let's print the error returned by the callback.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
hw/scsi/virtio-scsi-dataplane.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c
index b778e05..e068297 100644
--- a/hw/scsi/virtio-scsi-dataplane.c
+++ b/hw/scsi/virtio-scsi-dataplane.c
@@ -45,10 +45,13 @@ static VirtIOSCSIVring *virtio_scsi_vring_init(VirtIOSCSI *s,
BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(s)));
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
VirtIOSCSIVring *r = g_slice_new(VirtIOSCSIVring);
+ int rc;
/* Set up virtqueue notify */
- if (k->set_host_notifier(qbus->parent, n, true) != 0) {
- fprintf(stderr, "virtio-scsi: Failed to set host notifier\n");
+ rc = k->set_host_notifier(qbus->parent, n, true);
+ if (rc != 0) {
+ fprintf(stderr, "virtio-scsi: Failed to set host notifier (%d)\n",
+ rc);
exit(1);
}
r->host_notifier = *virtio_queue_get_host_notifier(vq);
@@ -157,8 +160,8 @@ void virtio_scsi_dataplane_start(VirtIOSCSI *s)
/* Set up guest notifier (irq) */
rc = k->set_guest_notifiers(qbus->parent, vs->conf.num_queues + 2, true);
if (rc != 0) {
- fprintf(stderr, "virtio-scsi: Failed to set guest notifiers, "
- "ensure -enable-kvm is set\n");
+ fprintf(stderr, "virtio-scsi: Failed to set guest notifiers (%d), "
+ "ensure -enable-kvm is set\n", rc);
exit(1);
}
--
1.8.5.5
next prev parent reply other threads:[~2014-10-15 13:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-15 13:15 [Qemu-devel] [PATCH 0/3] virtio-scsi-dataplane: graceful fail Cornelia Huck
2014-10-15 13:15 ` Cornelia Huck [this message]
2014-10-15 13:15 ` [Qemu-devel] [PATCH 2/3] virtio-scsi: dataplane: fail setup gracefully Cornelia Huck
2014-10-15 13:15 ` [Qemu-devel] [PATCH 3/3] virtio-scsi: dataplane: stop trying on notifier error Cornelia Huck
2014-10-21 12:51 ` [Qemu-devel] [PATCH 0/3] virtio-scsi-dataplane: graceful fail Paolo Bonzini
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=1413378926-52442-2-git-send-email-cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=famz@redhat.com \
--cc=pbonzini@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).