aboutsummaryrefslogtreecommitdiff
path: root/hw/vhost.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2011-08-11 10:21:18 +0300
committerMichael S. Tsirkin <mst@redhat.com>2011-08-26 11:25:25 +0300
commitb0b3db79559e57db340b292621c397e7a6cdbdc5 (patch)
tree25519d7db0fa1fe99469b2e10d2423dd69ad6de2 /hw/vhost.h
parentc9abe111209abca1b910e35c6ca9888aced5f183 (diff)
vhost-net: cleanup host notifiers at last step
When the vhost notifier is disabled, the userspace handler runs immediately: virtio_pci_set_host_notifier_internal might call virtio_queue_notify_vq. Since the VQ state and the tap backend state aren't recovered yet, this causes "Guest moved used index from XXX to YYY" assertions. The solution is to split out host notifier handling from vhost VQ setup and disable notifiers as our last step when we stop vhost-net. For symmetry enable them first thing on start. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/vhost.h')
-rw-r--r--hw/vhost.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/vhost.h b/hw/vhost.h
index c8c595a147..c9452f0732 100644
--- a/hw/vhost.h
+++ b/hw/vhost.h
@@ -46,5 +46,7 @@ void vhost_dev_cleanup(struct vhost_dev *hdev);
bool vhost_dev_query(struct vhost_dev *hdev, VirtIODevice *vdev);
int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev);
void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev);
+int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev);
+void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev);
#endif