qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 11/15] block: add bdrv_find_backing_image


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v4 11/15] block: add bdrv_find_backing_image
Date: Thu, 12 Jan 2012 13:17:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0

Am 06.01.2012 15:01, schrieb Stefan Hajnoczi:
> From: Marcelo Tosatti <address@hidden>
> 
> Add bdrv_find_backing_image: given a BlockDriverState pointer, and an id,
> traverse the backing image chain to locate the id.
> 
> Signed-off-by: Marcelo Tosatti <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
>  block.c |   17 +++++++++++++++++
>  block.h |    1 +
>  2 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/block.c b/block.c
> index 5bfaa3a..9b688a0 100644
> --- a/block.c
> +++ b/block.c
> @@ -2614,6 +2614,23 @@ int bdrv_snapshot_load_tmp(BlockDriverState *bs,
>      return -ENOTSUP;
>  }
>  
> +BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs, const char 
> *id)
> +{
> +    if (!bs->drv) {
> +        return NULL;
> +    }
> +
> +    if (bs->backing_hd) {
> +        if (strcmp(bs->backing_file, id) == 0) {
> +            return bs->backing_hd;

So it's not really just some id, but the backing file name? I would find
it clearer to reflect that in the parameter name and the QMP error in
the next patch.

Kevin



reply via email to

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