qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: pbonzini@redhat.com, peter.crosthwaite@xilinx.com,
	qemu-devel@nongnu.org, afaerber@suse.de,
	fred.konrad@greensocs.com
Subject: [Qemu-devel] [PATCH 1/1] dataplane: bail out on unsupported transport
Date: Tue,  3 Jun 2014 17:31:06 +0200	[thread overview]
Message-ID: <1401809466-4304-1-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <20140603171123.49fb8b8f.cornelia.huck@de.ibm.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 <cornelia.huck@de.ibm.com>
---
 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

  reply	other threads:[~2014-06-03 15:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1401448669-4655-1-git-send-email-stefanha@redhat.com>
     [not found] ` <1401448669-4655-6-git-send-email-stefanha@redhat.com>
2014-06-02  9:49   ` [Qemu-devel] [PATCH v3 5/8] virtio-blk: use aliases instead of duplicate qdev properties Peter Crosthwaite
     [not found] ` <1401448669-4655-4-git-send-email-stefanha@redhat.com>
2014-06-02 15:42   ` [Qemu-devel] [PATCH v3 3/8] virtio-blk: move x-data-plane qdev property to virtio-blk.h Cornelia Huck
2014-06-03 15:11 ` [Qemu-devel] [PATCH v3 0/8] virtio-blk: use alias properties in transport devices Cornelia Huck
2014-06-03 15:31   ` Cornelia Huck [this message]
2014-06-04  8:10     ` [Qemu-devel] [PATCH 1/1] dataplane: bail out on unsupported transport Stefan Hajnoczi
2014-06-04  8:08   ` [Qemu-devel] [PATCH v3 0/8] virtio-blk: use alias properties in transport devices Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401809466-4304-1-git-send-email-cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=afaerber@suse.de \
    --cc=fred.konrad@greensocs.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).