From 76143618a5a9f33e8bc968f27b3de79d79a286c5 Mon Sep 17 00:00:00 2001 From: Gal Hammer Date: Mon, 29 Jan 2018 16:20:56 +0200 Subject: virtio: remove event notifier cleanup call on de-assign The virtio_bus_set_host_notifier function no longer calls event_notifier_cleanup when a event notifier is removed. The commit updates the code to match the new behavior and calls virtio_bus_cleanup_host_notifier after the notifier was de-assign and no longer in use. This change is a preparation to allow executing the virtio_bus_set_host_notifier function in a memory region transaction. Signed-off-by: Gal Hammer Reviewed-by: Greg Kurz Tested-by: Greg Kurz Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/scsi/virtio-scsi-dataplane.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hw/scsi/virtio-scsi-dataplane.c') diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c index add4b3f..1c33322 100644 --- a/hw/scsi/virtio-scsi-dataplane.c +++ b/hw/scsi/virtio-scsi-dataplane.c @@ -175,6 +175,7 @@ fail_vrings: aio_context_release(s->ctx); for (i = 0; i < vs->conf.num_queues + 2; i++) { virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); + virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), i); } k->set_guest_notifiers(qbus->parent, vs->conf.num_queues + 2, false); fail_guest_notifiers: @@ -213,6 +214,7 @@ void virtio_scsi_dataplane_stop(VirtIODevice *vdev) for (i = 0; i < vs->conf.num_queues + 2; i++) { virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); + virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), i); } /* Clean up guest notifier (irq) */ -- cgit v1.1