diff options
Diffstat (limited to 'hw/virtio/virtio-bus.c')
-rw-r--r-- | hw/virtio/virtio-bus.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c index a8d2bd8..3ffec66 100644 --- a/hw/virtio/virtio-bus.c +++ b/hw/virtio/virtio-bus.c @@ -193,7 +193,7 @@ int virtio_bus_start_ioeventfd(VirtioBusState *bus) VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev); int r; - if (!k->ioeventfd_assign || k->ioeventfd_disabled(proxy)) { + if (!k->ioeventfd_assign || !k->ioeventfd_enabled(proxy)) { return -ENOSYS; } if (bus->ioeventfd_started || bus->ioeventfd_disabled) { @@ -223,6 +223,14 @@ void virtio_bus_stop_ioeventfd(VirtioBusState *bus) bus->ioeventfd_started = false; } +bool virtio_bus_ioeventfd_enabled(VirtioBusState *bus) +{ + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(bus); + DeviceState *proxy = DEVICE(BUS(bus)->parent); + + return k->ioeventfd_assign && k->ioeventfd_enabled(proxy); +} + /* * This function switches from/to the generic ioeventfd handler. * assign==false means 'use generic ioeventfd handler'. |