qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v2 3/3] block/stream: introduce a bottom node


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] [PATCH v2 3/3] block/stream: introduce a bottom node
Date: Mon, 1 Apr 2019 12:39:12 +0000

01.04.2019 15:06, Andrey Shinkevich wrote:
> The bottom node is the intermediate block device that has the base as its
> backing image. It is used instead of the base node while a block stream
> job is running to avoid dependency on the base that may change due to the
> parallel jobs. The change may take place due to a filter node as well that
> is inserted between the base and the intermediate bottom node. It occurs
> when the base node is the top one for another commit or stream job.
> After the introduction of the bottom node, don't freeze its backing child,
> that's the base, anymore.
> 
> Suggested-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> Signed-off-by: Andrey Shinkevich <address@hidden>
> ---
>   block/stream.c            | 54 
> +++++++++++++++++++++++------------------------
>   block/trace-events        |  2 +-
>   blockdev.c                |  7 +++++-
>   include/block/block_int.h |  6 +++---
>   tests/qemu-iotests/245    |  4 ++--
>   5 files changed, 39 insertions(+), 34 deletions(-)
> 

[..]

> diff --git a/blockdev.c b/blockdev.c
> index 4775a07..ce0cad4 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -3164,6 +3164,7 @@ void qmp_block_stream(bool has_job_id, const char 
> *job_id, const char *device,
>   {
>       BlockDriverState *bs, *iter;
>       BlockDriverState *base_bs = NULL;
> +    BlockDriverState *bottom_node = NULL;
>       AioContext *aio_context;
>       Error *local_err = NULL;
>       const char *base_name = NULL;
> @@ -3237,7 +3238,11 @@ void qmp_block_stream(bool has_job_id, const char 
> *job_id, const char *device,
>           job_flags |= JOB_MANUAL_DISMISS;
>       }
>   
> -    stream_start(has_job_id ? job_id : NULL, bs, base_bs, base_name,
> +    /* Find the bottom node that has the base as its backing image */
> +    bottom_node = bdrv_find_overlay(bs, base_bs);
> +    assert(bottom_node);

assert seems unnecessary now and even bottom_node variable. I think you can 
just call
bdrv_find_overly inside stream_start() parameter list.

with or without this change:
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>




-- 
Best regards,
Vladimir

reply via email to

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