[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 13/16] block: Implement bdrv_append() without
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [PATCH v3 13/16] block: Implement bdrv_append() without bdrv_swap() |
Date: |
Mon, 12 Oct 2015 16:27:55 +0200 |
User-agent: |
Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) |
On Fri 09 Oct 2015 02:15:38 PM CEST, Kevin Wolf wrote:
> +static void change_parent_backing_link(BlockDriverState *from,
> + BlockDriverState *to)
> +{
> + BdrvChild *c, *next;
> +
> + QLIST_FOREACH_SAFE(c, &from->parents, next_parent, next) {
> + assert(c->role != &child_backing);
> + c->bs = to;
> + QLIST_REMOVE(c, next_parent);
> + QLIST_INSERT_HEAD(&to->parents, c, next_parent);
> + bdrv_ref(to);
> + bdrv_unref(from);
> + }
> + if (from->blk) {
> + blk_set_bs(from->blk, to);
> + if (!to->device_list.tqe_prev) {
> + QTAILQ_INSERT_BEFORE(from, to, device_list);
> + }
Is it even possible that this last condition is false? In what case
would 'to' be already in bdrv_states?
I understand that it would mean that it would already be attached to a
BlockBackend, but that's not possible in this case.
Berto
- [Qemu-devel] [PATCH v3 05/16] block: Convert bs->file to BdrvChild, (continued)
- [Qemu-devel] [PATCH v3 05/16] block: Convert bs->file to BdrvChild, Kevin Wolf, 2015/10/09
- [Qemu-devel] [PATCH v3 03/16] blkverify: Convert s->test_file to BdrvChild, Kevin Wolf, 2015/10/09
- [Qemu-devel] [PATCH v3 04/16] quorum: Convert to BdrvChild, Kevin Wolf, 2015/10/09
- [Qemu-devel] [PATCH v3 09/16] block: Split bdrv_move_feature_fields(), Kevin Wolf, 2015/10/09
- [Qemu-devel] [PATCH v3 12/16] block: Introduce parents list, Kevin Wolf, 2015/10/09
- [Qemu-devel] [PATCH v3 13/16] block: Implement bdrv_append() without bdrv_swap(), Kevin Wolf, 2015/10/09
- Re: [Qemu-devel] [PATCH v3 13/16] block: Implement bdrv_append() without bdrv_swap(),
Alberto Garcia <=
- [Qemu-devel] [PATCH v3 01/16] block: Introduce BDS.file_child, Kevin Wolf, 2015/10/09
- [Qemu-devel] [PATCH v3 10/16] block/io: Make bdrv_requests_pending() public, Kevin Wolf, 2015/10/09
- [Qemu-devel] [PATCH v3 08/16] block: Manage backing file references in bdrv_set_backing_hd(), Kevin Wolf, 2015/10/09
- [Qemu-devel] [PATCH v3 02/16] vmdk: Use BdrvChild instead of BDS for references to extents, Kevin Wolf, 2015/10/10