[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 08/16] block: Manage backing file references in
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [PATCH 08/16] block: Manage backing file references in bdrv_set_backing_hd() |
Date: |
Mon, 28 Sep 2015 14:29:39 +0200 |
User-agent: |
Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) |
On Thu 17 Sep 2015 03:48:12 PM CEST, Kevin Wolf <address@hidden> wrote:
> --- a/block/stream.c
> +++ b/block/stream.c
> @@ -55,28 +55,7 @@ static int coroutine_fn stream_populate(BlockDriverState
> *bs,
> static void close_unused_images(BlockDriverState *top, BlockDriverState
> *base,
> const char *base_id)
> {
> - BlockDriverState *intermediate;
> - intermediate = top->backing ? top->backing->bs : NULL;
> -
> - /* Must assign before bdrv_delete() to prevent traversing dangling
> pointer
> - * while we delete backing image instances.
> - */
> bdrv_set_backing_hd(top, base);
> -
> - while (intermediate) {
> - BlockDriverState *unused;
> -
> - /* reached base */
> - if (intermediate == base) {
> - break;
> - }
> -
> - unused = intermediate;
> - intermediate = intermediate->backing ? intermediate->backing->bs :
> NULL;
> - bdrv_set_backing_hd(unused, NULL);
> - bdrv_unref(unused);
> - }
> -
> bdrv_refresh_limits(top, NULL);
> }
bdrv_refresh_limits(bs, NULL) is already called at the end of
bdrv_set_backing_hd(), so there's no need to call it again here.
And then close_unused_images() is used only once in this file and it
would only contain the bdrv_set_backing_hd() call, so you don't need a
separate function anymore.
Berto
- [Qemu-devel] [PATCH 04/16] quorum: Convert to BdrvChild, (continued)
- [Qemu-devel] [PATCH 04/16] quorum: Convert to BdrvChild, Kevin Wolf, 2015/09/17
- [Qemu-devel] [PATCH 06/16] block: Remove bdrv_open_image(), Kevin Wolf, 2015/09/17
- [Qemu-devel] [PATCH 09/16] block: Split bdrv_move_feature_fields(), Kevin Wolf, 2015/09/17
- [Qemu-devel] [PATCH 08/16] block: Manage backing file references in bdrv_set_backing_hd(), Kevin Wolf, 2015/09/17
- [Qemu-devel] [PATCH 10/16] block/io: Make bdrv_requests_pending() public, Kevin Wolf, 2015/09/17
- [Qemu-devel] [PATCH 11/16] block-backend: Add blk_set_bs(), Kevin Wolf, 2015/09/17
- [Qemu-devel] [PATCH 07/16] block: Convert bs->backing_hd to BdrvChild, Kevin Wolf, 2015/09/17
- [Qemu-devel] [PATCH 14/16] blockjob: Store device name at job creation, Kevin Wolf, 2015/09/17