From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrqgL-0003SJ-Oy for qemu-devel@nongnu.org; Tue, 03 Jun 2014 11:31:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrqgC-0006Jm-K1 for qemu-devel@nongnu.org; Tue, 03 Jun 2014 11:31:21 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:34342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrqgC-0006JU-BH for qemu-devel@nongnu.org; Tue, 03 Jun 2014 11:31:12 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Jun 2014 16:31:10 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id E77391B0804B for ; Tue, 3 Jun 2014 16:31:30 +0100 (BST) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s53FV7vt21561384 for ; Tue, 3 Jun 2014 15:31:08 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 s53FV7Y3022332 for ; Tue, 3 Jun 2014 09:31:07 -0600 From: Cornelia Huck Date: Tue, 3 Jun 2014 17:31:06 +0200 Message-Id: <1401809466-4304-1-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <20140603171123.49fb8b8f.cornelia.huck@de.ibm.com> References: <20140603171123.49fb8b8f.cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH 1/1] dataplane: bail out on unsupported transport List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: pbonzini@redhat.com, peter.crosthwaite@xilinx.com, qemu-devel@nongnu.org, afaerber@suse.de, fred.konrad@greensocs.com If the virtio transport does not support notifiers (like s390-virtio), we can't use dataplane. Bail out early and let the user know what is wrong. Signed-off-by: Cornelia Huck --- hw/block/dataplane/virtio-blk.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index e49c253..e0c653f 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -354,6 +354,8 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *blk, VirtIOBlockDataPlane *s; int fd; Error *local_err = NULL; + BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev))); + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); *dataplane = NULL; @@ -361,6 +363,14 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *blk, return; } + /* Don't try if transport does not support notifiers. */ + if (!k->set_guest_notifiers || !k->set_host_notifier) { + error_setg(errp, + "device is incompatible with x-data-plane " + "(transport does not support notifiers)"); + return; + } + if (blk->scsi) { error_setg(errp, "device is incompatible with x-data-plane, use scsi=off"); -- 1.8.5.5