[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 02/10] block: reverse order for reopen commits
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-devel] [PATCH v4 02/10] block: reverse order for reopen commits |
Date: |
Wed, 7 Aug 2019 17:12:18 +0300 |
It's needed to fix reopening qcow2 with bitmaps to RW. Currently it
can't work, as qcow2 needs write access to file child, to mark bitmaps
in-image with IN_USE flag. But usually children goes after parents in
reopen queue and file child is still RO on qcow2 reopen commit. Reverse
reopen order to fix it.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
block.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/block.c b/block.c
index 696162cd7a..d59f9f97cb 100644
--- a/block.c
+++ b/block.c
@@ -3476,10 +3476,16 @@ int bdrv_reopen_multiple(BlockReopenQueue *bs_queue,
Error **errp)
bs_entry->perms_checked = true;
}
- /* If we reach this point, we have success and just need to apply the
- * changes
+ /*
+ * If we reach this point, we have success and just need to apply the
+ * changes.
+ *
+ * Reverse order is used to comfort qcow2 driver: on commit it need to
write
+ * IN_USE flag to the image, to mark bitmaps in the image as invalid. But
+ * children are usually goes after parents in reopen-queue, so go from last
+ * to first element.
*/
- QTAILQ_FOREACH(bs_entry, bs_queue, entry) {
+ QTAILQ_FOREACH_REVERSE(bs_entry, bs_queue, entry) {
bdrv_reopen_commit(&bs_entry->state);
}
--
2.18.0
- [Qemu-devel] [PATCH v4 00/10] qcow2-bitmaps: rewrite reopening logic, Vladimir Sementsov-Ogievskiy, 2019/08/07
- [Qemu-devel] [PATCH v4 10/10] qcow2-bitmap: move bitmap reopen-rw code to qcow2_reopen_commit, Vladimir Sementsov-Ogievskiy, 2019/08/07
- [Qemu-devel] [PATCH v4 01/10] block: switch reopen queue from QSIMPLEQ to QTAILQ, Vladimir Sementsov-Ogievskiy, 2019/08/07
- [Qemu-devel] [PATCH v4 07/10] block/qcow2-bitmap: do not remove bitmaps on reopen-ro, Vladimir Sementsov-Ogievskiy, 2019/08/07
- [Qemu-devel] [PATCH v4 06/10] block/qcow2-bitmap: drop qcow2_reopen_bitmaps_rw_hint(), Vladimir Sementsov-Ogievskiy, 2019/08/07
- [Qemu-devel] [PATCH v4 05/10] block/qcow2-bitmap: get rid of bdrv_has_changed_persistent_bitmaps, Vladimir Sementsov-Ogievskiy, 2019/08/07
- [Qemu-devel] [PATCH v4 08/10] iotests: add test 260 to check bitmap life after snapshot + commit, Vladimir Sementsov-Ogievskiy, 2019/08/07
- [Qemu-devel] [PATCH v4 04/10] iotests.py: add event_wait_log and events_wait_log helpers, Vladimir Sementsov-Ogievskiy, 2019/08/07
- [Qemu-devel] [PATCH v4 02/10] block: reverse order for reopen commits,
Vladimir Sementsov-Ogievskiy <=
- [Qemu-devel] [PATCH v4 03/10] iotests: add test-case to 165 to test reopening qcow2 bitmaps to RW, Vladimir Sementsov-Ogievskiy, 2019/08/07
- [Qemu-devel] [PATCH v4 09/10] block/qcow2-bitmap: fix and improve qcow2_reopen_bitmaps_rw, Vladimir Sementsov-Ogievskiy, 2019/08/07