qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ying-Shiuan Pan <yingshiuan.pan@gmail.com>
To: qemu-devel@nongnu.org
Cc: wbarak@gmail.com, Ying-Shiuan Pan <yingshiuan.pan@gmail.com>,
	yspan@itri.org.tw
Subject: [Qemu-devel] [PATCH 4/4] virtio-mmio: add a new property for ioeventfd
Date: Thu,  6 Feb 2014 01:03:39 +0800	[thread overview]
Message-ID: <1391619819-10525-5-git-send-email-yingshiuan.pan@gmail.com> (raw)
In-Reply-To: <1391619819-10525-1-git-send-email-yingshiuan.pan@gmail.com>

Make ioeventfd could be enabled or disabled (default). Since ioeventfd
is not yet ready in kvm-arm, without this option, qemu will get a
problem if it attempts to initialize ioeventfd.

To coincide this option of virtio-mmio with virtio-pci, I would like to
also move VIRTIO_PCI_FLAG_USE_IOEVENTFD to 'bool ioeventfd' of VirtIODevice.
Any better suggestion?

Signed-off-by: Ying-Shiuan Pan <yspan@itri.org.tw>
---
 hw/block/virtio-blk.c      | 1 +
 hw/net/virtio-net.c        | 1 +
 hw/virtio/virtio-mmio.c    | 3 ++-
 include/hw/virtio/virtio.h | 1 +
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 19d0961..befdfdf 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -756,6 +756,7 @@ static void virtio_blk_device_unrealize(DeviceState *dev, Error **errp)
 
 static Property virtio_blk_properties[] = {
     DEFINE_VIRTIO_BLK_PROPERTIES(VirtIOBlock, blk),
+    DEFINE_PROP_BOOL("ioeventfd", VirtIOBlock, parent_obj.use_ioeventfd, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 3626608..9b75e61 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1631,6 +1631,7 @@ static Property virtio_net_properties[] = {
                                                TX_TIMER_INTERVAL),
     DEFINE_PROP_INT32("x-txburst", VirtIONet, net_conf.txburst, TX_BURST),
     DEFINE_PROP_STRING("tx", VirtIONet, net_conf.tx),
+    DEFINE_PROP_BOOL("ioeventfd", VirtIONet, parent_obj.use_ioeventfd, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c
index 11964ee..3f7a341 100644
--- a/hw/virtio/virtio-mmio.c
+++ b/hw/virtio/virtio-mmio.c
@@ -127,7 +127,8 @@ static void virtio_mmio_start_ioeventfd(VirtIOMMIOProxy *proxy)
     VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
     int n, r;
 
-    if (proxy->ioeventfd_disabled ||
+    if (!vdev->use_ioeventfd ||
+        proxy->ioeventfd_disabled ||
         proxy->ioeventfd_started) {
         return;
     }
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 3e54e90..d4cb3bf 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -121,6 +121,7 @@ struct VirtIODevice
     bool vm_running;
     VMChangeStateEntry *vmstate;
     char *bus_name;
+    bool use_ioeventfd;
 };
 
 typedef struct VirtioDeviceClass {
-- 
1.8.1.2

  parent reply	other threads:[~2014-02-05 17:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 17:03 [Qemu-devel] [PATCH 0/4] ioeventfd support for virtio-mmio Ying-Shiuan Pan
2014-02-05 17:03 ` [Qemu-devel] [PATCH 1/4] virtio-mmio: introduce set_host_notifier() Ying-Shiuan Pan
2014-02-05 17:03 ` [Qemu-devel] [PATCH 2/4] virtio-mmio: introduce set_guest_notifiers Ying-Shiuan Pan
2014-02-05 17:03 ` [Qemu-devel] [PATCH 3/4] virtio-mmio: start ioeventfd when status gets DRIVER_OK Ying-Shiuan Pan
2014-02-05 17:03 ` Ying-Shiuan Pan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-04 12:47 [Qemu-devel] [PATCH 0/4] ioeventfd support for virtio-mmio Shannon Zhao
2014-11-04 12:47 ` [Qemu-devel] [PATCH 4/4] virtio-mmio: add a new property for ioeventfd Shannon Zhao

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=1391619819-10525-5-git-send-email-yingshiuan.pan@gmail.com \
    --to=yingshiuan.pan@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wbarak@gmail.com \
    --cc=yspan@itri.org.tw \
    /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).