On Fri, May 23, 2014 at 11:23:22AM +0800, Fam Zheng wrote:
> We need to handle the coming backing_blocker properly, so don't open
> code the assignment, instead, call bdrv_set_backing_hd to change
> backing_hd.
> 
> Signed-off-by: Fam Zheng <f...@redhat.com>
> ---
>  block.c        | 4 ++--
>  block/stream.c | 4 ++--
>  block/vvfat.c  | 2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/block.c b/block.c
> index 911ba68..91c866c 100644
> --- a/block.c
> +++ b/block.c
> @@ -2652,13 +2652,13 @@ int bdrv_drop_intermediate(BlockDriverState *active, 
> BlockDriverState *top,
>      if (ret) {
>          goto exit;
>      }
> -    new_top_bs->backing_hd = base_bs;
> +    bdrv_set_backing_hd(new_top_bs, base_bs);
>  
>      bdrv_refresh_limits(new_top_bs);

bdrv_set_backing_hd() already does bdrv_refresh_limits() when backing_hd
!= NULL (and base_bs is always non-NULL in this code path).  The
bdrv_refresh_limits() can be dropped.

Reply via email to