[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v4 06/13] block: Generalize should_update_child(
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-block] [PATCH v4 06/13] block: Generalize should_update_child() rule |
Date: |
Thu, 19 Apr 2018 17:19:46 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Wed 11 Apr 2018 08:54:18 PM CEST, Max Reitz wrote:
> Currently, bdrv_replace_node() refuses to create loops from one BDS to
> itself if the BDS to be replaced is the backing node of the BDS to
> replace it: Say there is a node A and a node B. Replacing B by A means
> making all references to B point to A. If B is a child of A (i.e. A has
> a reference to B), that would mean we would have to make this reference
> point to A itself -- so we'd create a loop.
>
> bdrv_replace_node() (through should_update_child()) refuses to do so if
> B is the backing node of A. There is no reason why we should create
> loops if B is not the backing node of A, though. The BDS graph should
> never contain loops, so we should always refuse to create them.
>
> If B is a child of A and B is to be replaced by A, we should simply
> leave B in place there because it is the most sensible choice.
>
> A more specific argument would be: Putting filter drivers into the BDS
> graph is basically the same as appending an overlay to a backing chain.
> But the main child BDS of a filter driver is not "backing" but "file",
> so restricting the no-loop rule to backing nodes would fail here.
>
> Signed-off-by: Max Reitz <address@hidden>
> Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Berto
- [Qemu-block] [PATCH v4 for-2.13 00/13] block/mirror: Add active-sync mirroring, Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 01/13] block/mirror: Pull out mirror_perform(), Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 02/13] block/mirror: Convert to coroutines, Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 03/13] block/mirror: Use CoQueue to wait on in-flight ops, Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 04/13] block/mirror: Wait for in-flight op conflicts, Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 05/13] block/mirror: Use source as a BdrvChild, Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 06/13] block: Generalize should_update_child() rule, Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 07/13] hbitmap: Add @advance param to hbitmap_iter_next(), Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 08/13] test-hbitmap: Add non-advancing iter_next tests, Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 09/13] block/dirty-bitmap: Add bdrv_dirty_iter_next_area, Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 10/13] block/mirror: Add MirrorBDSOpaque, Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 11/13] block/mirror: Add active mirroring, Max Reitz, 2018/04/11
- [Qemu-block] [PATCH v4 12/13] block/mirror: Add copy mode QAPI interface, Max Reitz, 2018/04/11