From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeOQc-0000YN-VC for qemu-devel@nongnu.org; Wed, 15 Oct 2014 09:15:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XeOQT-0003e2-6w for qemu-devel@nongnu.org; Wed, 15 Oct 2014 09:15:46 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:34137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeOQS-0003cy-PR for qemu-devel@nongnu.org; Wed, 15 Oct 2014 09:15:37 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 15 Oct 2014 14:15:33 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 7D60217D8056 for ; Wed, 15 Oct 2014 14:17:48 +0100 (BST) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9FDFVNc58327058 for ; Wed, 15 Oct 2014 13:15:31 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s9FDFVpH005158 for ; Wed, 15 Oct 2014 07:15:31 -0600 From: Cornelia Huck Date: Wed, 15 Oct 2014 15:15:24 +0200 Message-Id: <1413378926-52442-2-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1413378926-52442-1-git-send-email-cornelia.huck@de.ibm.com> References: <1413378926-52442-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH 1/3] virtio-scsi: dataplane: print why starting failed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: pbonzini@redhat.com, famz@redhat.com Cc: Cornelia Huck , qemu-devel@nongnu.org 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 --- 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