qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH v3 11/16] virtio-scsi: Request BLK_


From: Fam Zheng
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v3 11/16] virtio-scsi: Request BLK_PERM_AIO_CONTEXT_CHANGE for dataplane
Date: Wed, 7 Jun 2017 16:11:29 +0800
User-agent: Mutt/1.8.0 (2017-02-23)

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 <address@hidden>
> ---
>  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
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]