On Wed, 05/24 10:52, Fam Zheng wrote: > blk_set_aio_context is audited by perm API, so follow the protocol and > request for permission first. > > Signed-off-by: Fam Zheng <f...@redhat.com> > --- > hw/scsi/virtio-scsi.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c > index 46a3e3f..074e235 100644 > --- a/hw/scsi/virtio-scsi.c > +++ b/hw/scsi/virtio-scsi.c > @@ -794,6 +794,10 @@ static void virtio_scsi_hotplug(HotplugHandler > *hotplug_dev, DeviceState *dev, > return; > } > virtio_scsi_acquire(s); > + if (!blk_request_perm(sd->conf.blk, BLK_PERM_AIO_CONTEXT_CHANGE, > errp)) {
Inversed condition, should be s/!//. Fam > + virtio_scsi_release(s); > + return; > + } > blk_set_aio_context(sd->conf.blk, s->ctx); > virtio_scsi_release(s); > > -- > 2.9.4 > >