[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/3] virtio-scsi: dataplane: print why starting fail
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PATCH 1/3] virtio-scsi: dataplane: print why starting failed |
Date: |
Wed, 15 Oct 2014 15:15:24 +0200 |
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 <address@hidden>
---
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