[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/28] virtio-scsi: dataplane: print why starting fai
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 02/28] virtio-scsi: dataplane: print why starting failed |
Date: |
Mon, 27 Oct 2014 16:13:19 +0100 |
From: Cornelia Huck <address@hidden>
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>
Signed-off-by: Paolo Bonzini <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 1f77635..999c783 100644
--- a/hw/scsi/virtio-scsi-dataplane.c
+++ b/hw/scsi/virtio-scsi-dataplane.c
@@ -46,10 +46,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);
@@ -160,8 +163,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.3.1
- [Qemu-devel] [PULL 00/28] Changes for 2014-10-27, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 06/28] qom: Demote already-has-a-parent to a regular error, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 07/28] qdev: gpio: Re-implement qdev_connect_gpio QOM style, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 02/28] virtio-scsi: dataplane: print why starting failed,
Paolo Bonzini <=
- [Qemu-devel] [PULL 04/28] virtio-scsi: dataplane: stop trying on notifier error, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 01/28] virtio-scsi-dataplane: Add op blocker, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 05/28] qom: Allow clearing of a Link property, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 09/28] qtest/irq: Rework IRQ interception, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 03/28] virtio-scsi: dataplane: fail setup gracefully, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 10/28] irq: Remove qemu_irq_intercept_out, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 08/28] qdev: gpio: Add API for intercepting a GPIO, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 11/28] qdev: gpio: delete NamedGPIOList::out, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 12/28] qdev: gpio: Remove qdev_init_gpio_out x1 restriction, Paolo Bonzini, 2014/10/27
- [Qemu-devel] [PULL 13/28] qdev: gpio: Define qdev_pass_gpios(), Paolo Bonzini, 2014/10/27