[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/4] virtio-mmio: add a new property for ioeventfd
From: |
Ying-Shiuan Pan |
Subject: |
[Qemu-devel] [PATCH 4/4] virtio-mmio: add a new property for ioeventfd |
Date: |
Thu, 6 Feb 2014 01:03:39 +0800 |
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 <address@hidden>
---
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