summaryrefslogtreecommitdiffstats
path: root/include/hw/virtio/virtio-bus.h
diff options
context:
space:
mode:
authorStefan Hajnoczi2016-11-21 12:09:58 +0100
committerStefan Hajnoczi2016-11-21 12:09:58 +0100
commitc36ed06e9159fa484b711dfdd27ec64d7ac3d17a (patch)
treee87010bcb634dd0ed1f2abb8123e044d308e4a71 /include/hw/virtio/virtio-bus.h
parentMerge remote-tracking branch 'public/tags/tracing-pull-request' into staging (diff)
parentacpi: Use apic_id_limit when calculating legacy ACPI table size (diff)
downloadqemu-c36ed06e9159fa484b711dfdd27ec64d7ac3d17a.tar.gz
qemu-c36ed06e9159fa484b711dfdd27ec64d7ac3d17a.tar.xz
qemu-c36ed06e9159fa484b711dfdd27ec64d7ac3d17a.zip
Merge remote-tracking branch 'mst/tags/for_upstream' into staging
virtio, vhost, pc: fixes Most notably this fixes a regression with vhost introduced by the pull before last. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Fri 18 Nov 2016 03:51:55 PM GMT # gpg: using RSA key 0x281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * mst/tags/for_upstream: acpi: Use apic_id_limit when calculating legacy ACPI table size ipmi: fix qemu crash while migrating with ipmi ivshmem: Fix 64 bit memory bar configuration virtio: set ISR on dataplane notifications virtio: access ISR atomically virtio: introduce grab/release_ioeventfd to fix vhost virtio-crypto: fix virtio_queue_set_notification() race Message-id: 1479484366-7977-1-git-send-email-mst@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/hw/virtio/virtio-bus.h')
-rw-r--r--include/hw/virtio/virtio-bus.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h
index fdf7fdab81..8a51e2c564 100644
--- a/include/hw/virtio/virtio-bus.h
+++ b/include/hw/virtio/virtio-bus.h
@@ -97,6 +97,16 @@ struct VirtioBusState {
* Set if ioeventfd has been started.
*/
bool ioeventfd_started;
+
+ /*
+ * Set if ioeventfd has been grabbed by vhost. When ioeventfd
+ * is grabbed by vhost, we track its started/stopped state (which
+ * depends in turn on the virtio status register), but do not
+ * register a handler for the ioeventfd. When ioeventfd is
+ * released, if ioeventfd_started is true we finally register
+ * the handler so that QEMU's device model can use ioeventfd.
+ */
+ int ioeventfd_grabbed;
};
void virtio_bus_device_plugged(VirtIODevice *vdev, Error **errp);
@@ -131,6 +141,10 @@ bool virtio_bus_ioeventfd_enabled(VirtioBusState *bus);
int virtio_bus_start_ioeventfd(VirtioBusState *bus);
/* Stop the ioeventfd. */
void virtio_bus_stop_ioeventfd(VirtioBusState *bus);
+/* Tell the bus that vhost is grabbing the ioeventfd. */
+int virtio_bus_grab_ioeventfd(VirtioBusState *bus);
+/* bus that vhost is not using the ioeventfd anymore. */
+void virtio_bus_release_ioeventfd(VirtioBusState *bus);
/* Switch from/to the generic ioeventfd handler */
int virtio_bus_set_host_notifier(VirtioBusState *bus, int n, bool assign);