virtio-scsi: Set host notifiers and callbacks separately
commit61fc57bfc464c3584bd7ab810c86833661f0188c
authorGreg Kurz <groug@kaod.org>
Wed, 7 Apr 2021 14:35:00 +0000 (7 16:35 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 14 May 2021 14:26:18 +0000 (14 10:26 -0400)
treee542b66633cf064e19dd33df1e5ea7af74a106ca
parentd0267da614890b8f817364ae25850cdbb580a569
virtio-scsi: Set host notifiers and callbacks separately

Host notifiers are guaranteed to be idle until the callbacks are
hooked up with virtio_queue_aio_set_host_notifier_handler(). They
thus don't need to be set or unset with the AioContext lock held.

Do this outside the critical section, like virtio-blk already
does : basically downgrading virtio_scsi_vring_init() to only
setup the host notifier and set the callback in the caller.

This will allow to batch addition/deletion of ioeventds in
a single memory transaction, which is expected to greatly
improve initialization time.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20210407143501.244343-4-groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/scsi/virtio-scsi-dataplane.c