summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2014-10-15 15:15:24 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2014-10-23 16:41:24 +0200
commit6d2c83165bc981536f248dd9e3f25bf132b35867 (patch)
tree4d624d55879dd5e3b17f2d6e32abec565a369732 /hw
parent3e2b2a9c49f44926b995495be5e94e61e4f29f5e (diff)
downloadhqemu-6d2c83165bc981536f248dd9e3f25bf132b35867.zip
hqemu-6d2c83165bc981536f248dd9e3f25bf132b35867.tar.gz
virtio-scsi: dataplane: print why starting failed
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> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi/virtio-scsi-dataplane.c11
1 files 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);
}
OpenPOWER on IntegriCloud