From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com,
mreitz@redhat.com, jsnow@redhat.com
Subject: [Qemu-devel] [PATCH 2/5] block: Remove dirty bitmaps from bdrv_move_feature_fields()
Date: Mon, 14 Mar 2016 16:44:49 +0100 [thread overview]
Message-ID: <1457970292-12291-3-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1457970292-12291-1-git-send-email-kwolf@redhat.com>
This patch changes dirty bitmaps from following a BlockBackend in graph
changes to sticking with the node they were created at. For the full
discussion, read the following mailing list thread:
[Qemu-block] block: Dirty bitmaps and COR in bdrv_move_feature_fields()
https://lists.nongnu.org/archive/html/qemu-block/2016-02/msg00745.html
In summary, the justification for this change is:
* When moving the dirty bitmap to the top of the tree was introduced in
bdrv_append() in commit a9fc4408, it didn't actually have any effect
because there could never be a bitmap in use when bdrv_append() was
called (op blockers would prevent this). This is still true today for
all internal uses of dirty bitmaps.
* Support for user-defined dirty bitmaps was introduced in 2.4, but we
discouraged users from using it because we didn't consider it ready
yet.
Moreover, in 2.5, the bdrv_swap() removal introduced a bug that left
dangling pointers if a dirty bitmap was present (the anchors of the
dirty bitmap were swapped, but the back link in the first element
wasn't updated), so it didn't even work correctly.
* block-dirty-bitmap-add takes an arbitrary node name, even if no
BlockBackend is attached. This suggests that it is a node level
operation and not a BlockBackend one. Consequently, there is no reason
for dirty bitmaps to stay with a BlockBackend that was attached to the
node they were created for.
* It was suggested that block-dirty-bitmap-add could track the node if a
node name was specified, and track the BlockBackend if the device name
was specified. This would however be inconsistent with other QMP
commands. Commands that accept both device and node names currently
interpret the device name just as an alias for the current root node
of that BlockBackend.
* Dirty bitmaps have a name that is only unique amongst the bitmaps in a
specific node. Moving bitmaps could lead to name clashes. Automatic
renaming would involve too much magic.
* Persistent bitmaps are stored in a specific node. Moving them around
automatically might be at least surprising, but it would probably also
become a real problem because that would have to happen atomically
without the management tool knowing of the operation.
At the end of the day it seems to be very clear that it was a mistake to
include dirty bitmaps in bdrv_move_feature_fields(). The functionality
of moving bitmaps and/or attaching them to a BlockBackend instead will
probably be needed, but it should be done with a new explicit QMP
command or option.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/block.c b/block.c
index a75c4b3..698e2c7 100644
--- a/block.c
+++ b/block.c
@@ -2284,9 +2284,6 @@ static void bdrv_move_feature_fields(BlockDriverState *bs_dest,
/* dev info */
bs_dest->enable_write_cache = bs_src->enable_write_cache;
-
- /* dirty bitmap */
- bs_dest->dirty_bitmaps = bs_src->dirty_bitmaps;
}
static void change_parent_backing_link(BlockDriverState *from,
--
1.8.3.1
next prev parent reply other threads:[~2016-03-14 15:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 15:44 [Qemu-devel] [PATCH 0/5] block: API changes for 2.6 Kevin Wolf
2016-03-14 15:44 ` [Qemu-devel] [PATCH 1/5] block: Remove copy-on-read from bdrv_move_feature_fields() Kevin Wolf
2016-03-14 15:51 ` Eric Blake
2016-03-14 15:44 ` Kevin Wolf [this message]
2016-03-14 15:55 ` [Qemu-devel] [PATCH 2/5] block: Remove dirty bitmaps " Eric Blake
2016-03-14 15:44 ` [Qemu-devel] [PATCH 3/5] block: Remove cache.writeback from blockdev-add Kevin Wolf
2016-03-14 16:10 ` Eric Blake
2016-03-14 16:22 ` Kevin Wolf
2016-03-14 15:44 ` [Qemu-devel] [PATCH 4/5] block: Make backing files always writeback Kevin Wolf
2016-03-14 16:46 ` Eric Blake
2016-03-14 15:44 ` [Qemu-devel] [PATCH 5/5] block: Reject writethrough mode except at the root Kevin Wolf
2016-03-14 16:50 ` Eric Blake
2016-03-18 17:10 ` [Qemu-devel] [PATCH 0/5] block: API changes for 2.6 Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457970292-12291-3-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=jsnow@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).