From 8e93cef14e6f32adf6914b30b096039e6264f0e3 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 21 Oct 2016 22:48:08 +0200 Subject: virtio: introduce virtio_device_ioeventfd_enabled This will be used to forbid iothread configuration when the proxy does not allow using ioeventfd. To simplify the implementation, change the direction of the ioeventfd_disabled callback too. Reviewed-by: Stefan Hajnoczi Reviewed-by: Cornelia Huck Signed-off-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-mmio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hw/virtio/virtio-mmio.c') diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index 04a9655d84..a30270f902 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c @@ -92,9 +92,9 @@ typedef struct { bool format_transport_address; } VirtIOMMIOProxy; -static bool virtio_mmio_ioeventfd_disabled(DeviceState *d) +static bool virtio_mmio_ioeventfd_enabled(DeviceState *d) { - return !kvm_eventfds_enabled(); + return kvm_eventfds_enabled(); } static int virtio_mmio_ioeventfd_assign(DeviceState *d, @@ -531,7 +531,7 @@ static void virtio_mmio_bus_class_init(ObjectClass *klass, void *data) k->save_config = virtio_mmio_save_config; k->load_config = virtio_mmio_load_config; k->set_guest_notifiers = virtio_mmio_set_guest_notifiers; - k->ioeventfd_disabled = virtio_mmio_ioeventfd_disabled; + k->ioeventfd_enabled = virtio_mmio_ioeventfd_enabled; k->ioeventfd_assign = virtio_mmio_ioeventfd_assign; k->has_variable_vring_alignment = true; bus_class->max_dev = 1; -- cgit v1.2.3