qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH COLO-Block v6 06/16] Don't allow a disk use back


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH COLO-Block v6 06/16] Don't allow a disk use backing reference target
Date: Thu, 18 Jun 2015 13:47:29 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Jun 18, 2015 at 04:49:11PM +0800, Wen Congyang wrote:
> Signed-off-by: Wen Congyang <address@hidden>
> Signed-off-by: zhanghailiang <address@hidden>
> Signed-off-by: Gonglei <address@hidden>
> ---
>  block.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/block.c b/block.c
> index d1ed227..0b41af4 100644
> --- a/block.c
> +++ b/block.c
> @@ -1294,6 +1294,14 @@ static int 
> bdrv_open_backing_reference_file(BlockDriverState *bs,
>      }
>  
>      backing_hd = blk_bs(backing_blk);
> +    /* Don't allow a disk use backing reference target */
> +    ret = blk_attach_dev(backing_hd->blk, bs);
> +    if (ret < 0) {
> +        error_setg(errp, "backing_hd %s is used by the other device model",
> +                   backing_name);
> +        goto free_exit;
> +    }

Can you explain the purpose of this patch?

I'm not sure blk_attach_dev() is the appropriate API.  It is only used
by emulated devices but not by the run-time NBD server, for example.
This means you are not preventing all other users from accessing this
BDS.

The op blockers mechanism is normally used to prevent operations on a
BDS.  See bdrv_op_is_blocked() and bdrv_op_block().

Stefan

Attachment: pgpuN4hi8Mxty.pgp
Description: PGP signature


reply via email to

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