[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/47] virtio: use virtio_bus_set_host_notifier to st
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 13/47] virtio: use virtio_bus_set_host_notifier to start/stop ioeventfd |
Date: |
Sun, 30 Oct 2016 23:23:57 +0200 |
From: Paolo Bonzini <address@hidden>
ioeventfd_disabled was the only reason for the default
implementation of virtio_device_start_ioeventfd not to use
virtio_bus_set_host_notifier. This is now fixed, and the sole entry
point to set up ioeventfd can be virtio_bus_set_host_notifier.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/virtio/virtio-bus.h | 5 -----
hw/virtio/virtio-bus.c | 4 ++--
hw/virtio/virtio.c | 8 +++-----
3 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h
index cbdf745..fdf7fda 100644
--- a/include/hw/virtio/virtio-bus.h
+++ b/include/hw/virtio/virtio-bus.h
@@ -134,9 +134,4 @@ void virtio_bus_stop_ioeventfd(VirtioBusState *bus);
/* Switch from/to the generic ioeventfd handler */
int virtio_bus_set_host_notifier(VirtioBusState *bus, int n, bool assign);
-/* This is temporary. It is only needed because virtio_bus_set_host_notifier
- * sets ioeventfd_disabled but we will shortly get rid of it. */
-int set_host_notifier_internal(DeviceState *proxy, VirtioBusState *bus,
- int n, bool assign);
-
#endif /* VIRTIO_BUS_H */
diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c
index b0e4544..fd105b8 100644
--- a/hw/virtio/virtio-bus.c
+++ b/hw/virtio/virtio-bus.c
@@ -147,8 +147,8 @@ void virtio_bus_set_vdev_config(VirtioBusState *bus,
uint8_t *config)
}
}
-int set_host_notifier_internal(DeviceState *proxy, VirtioBusState *bus,
- int n, bool assign)
+static int set_host_notifier_internal(DeviceState *proxy, VirtioBusState *bus,
+ int n, bool assign)
{
VirtIODevice *vdev = virtio_bus_get_device(bus);
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(bus);
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 2ece690..b738163 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2145,14 +2145,13 @@ static Property virtio_properties[] = {
static int virtio_device_start_ioeventfd_impl(VirtIODevice *vdev)
{
VirtioBusState *qbus = VIRTIO_BUS(qdev_get_parent_bus(DEVICE(vdev)));
- DeviceState *proxy = DEVICE(BUS(qbus)->parent);
int n, r, err;
for (n = 0; n < VIRTIO_QUEUE_MAX; n++) {
if (!virtio_queue_get_num(vdev, n)) {
continue;
}
- r = set_host_notifier_internal(proxy, qbus, n, true);
+ r = virtio_bus_set_host_notifier(qbus, n, true);
if (r < 0) {
err = r;
goto assign_error;
@@ -2176,7 +2175,7 @@ assign_error:
continue;
}
- r = set_host_notifier_internal(proxy, qbus, n, false);
+ r = virtio_bus_set_host_notifier(qbus, n, false);
assert(r >= 0);
}
return err;
@@ -2193,14 +2192,13 @@ int virtio_device_start_ioeventfd(VirtIODevice *vdev)
static void virtio_device_stop_ioeventfd_impl(VirtIODevice *vdev)
{
VirtioBusState *qbus = VIRTIO_BUS(qdev_get_parent_bus(DEVICE(vdev)));
- DeviceState *proxy = DEVICE(BUS(qbus)->parent);
int n, r;
for (n = 0; n < VIRTIO_QUEUE_MAX; n++) {
if (!virtio_queue_get_num(vdev, n)) {
continue;
}
- r = set_host_notifier_internal(proxy, qbus, n, false);
+ r = virtio_bus_set_host_notifier(qbus, n, false);
assert(r >= 0);
}
}
--
MST
- [Qemu-devel] [PULL 03/47] virtio: disable ioeventfd as early as possible, (continued)
- [Qemu-devel] [PULL 03/47] virtio: disable ioeventfd as early as possible, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 04/47] virtio: move ioeventfd_disabled flag to VirtioBusState, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 05/47] virtio: move ioeventfd_started flag to VirtioBusState, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 06/47] virtio: add start_ioeventfd and stop_ioeventfd to VirtioDeviceClass, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 07/47] virtio: introduce virtio_device_ioeventfd_enabled, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 09/47] virtio-scsi: always use dataplane path if ioeventfd is active, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 08/47] virtio-blk: always use dataplane path if ioeventfd is active, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 10/47] Revert "virtio: Introduce virtio_add_queue_aio", Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 11/47] virtio: remove set_handler argument from set_host_notifier_internal, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 12/47] virtio: remove ioeventfd_disabled altogether, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 13/47] virtio: use virtio_bus_set_host_notifier to start/stop ioeventfd,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 14/47] virtio: inline virtio_queue_set_host_notifier_fd_handler, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 15/47] virtio: inline set_host_notifier_internal, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 16/47] cryptodev: introduce cryptodev backend interface, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 17/47] cryptodev: add symmetric algorithm operation stuff, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 18/47] virtio-crypto: introduce virtio_crypto.h, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 19/47] cryptodev: introduce a new cryptodev backend, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 20/47] virtio-crypto: add virtio crypto device emulation, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 21/47] virtio-crypto-pci: add virtio crypto pci support, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 22/47] virtio-crypto: set capacity of algorithms supported, Michael S. Tsirkin, 2016/10/30
- [Qemu-devel] [PULL 23/47] virtio-crypto: add control queue handler, Michael S. Tsirkin, 2016/10/30