|
|
4a2fec |
From 32f7f67152cf7ffe36917a2c436eb89871dcee92 Mon Sep 17 00:00:00 2001
|
|
|
4a2fec |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
4a2fec |
Date: Mon, 4 Dec 2017 12:10:04 +0100
|
|
|
4a2fec |
Subject: [PATCH 33/36] block: reopen: Queue children after their parents
|
|
|
4a2fec |
|
|
|
4a2fec |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
4a2fec |
Message-id: <20171204121007.12964-6-kwolf@redhat.com>
|
|
|
4a2fec |
Patchwork-id: 78107
|
|
|
4a2fec |
O-Subject: [RHV-7.5 qemu-kvm-rhev PATCH v2 5/8] block: reopen: Queue children after their parents
|
|
|
4a2fec |
Bugzilla: 1492178
|
|
|
4a2fec |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
4a2fec |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
4a2fec |
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
|
|
|
4a2fec |
|
|
|
4a2fec |
We will calculate the required new permissions in the prepare stage of a
|
|
|
4a2fec |
reopen. Required permissions of children can be influenced by the
|
|
|
4a2fec |
changes made to their parents, but parents are independent from their
|
|
|
4a2fec |
children. This means that permissions need to be calculated top-down. In
|
|
|
4a2fec |
order to achieve this, queue parents before their children rather than
|
|
|
4a2fec |
queuing the children first.
|
|
|
4a2fec |
|
|
|
4a2fec |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
4a2fec |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
4a2fec |
(cherry picked from commit 1857c97b76af02537b954c86dab066503950a4fd)
|
|
|
4a2fec |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
4a2fec |
---
|
|
|
4a2fec |
block.c | 26 +++++++++++++-------------
|
|
|
4a2fec |
1 file changed, 13 insertions(+), 13 deletions(-)
|
|
|
4a2fec |
|
|
|
4a2fec |
diff --git a/block.c b/block.c
|
|
|
4a2fec |
index 5cce274..0a7e2c6 100644
|
|
|
4a2fec |
--- a/block.c
|
|
|
4a2fec |
+++ b/block.c
|
|
|
4a2fec |
@@ -2767,6 +2767,19 @@ static BlockReopenQueue *bdrv_reopen_queue_child(BlockReopenQueue *bs_queue,
|
|
|
4a2fec |
flags |= BDRV_O_ALLOW_RDWR;
|
|
|
4a2fec |
}
|
|
|
4a2fec |
|
|
|
4a2fec |
+ if (!bs_entry) {
|
|
|
4a2fec |
+ bs_entry = g_new0(BlockReopenQueueEntry, 1);
|
|
|
4a2fec |
+ QSIMPLEQ_INSERT_TAIL(bs_queue, bs_entry, entry);
|
|
|
4a2fec |
+ } else {
|
|
|
4a2fec |
+ QDECREF(bs_entry->state.options);
|
|
|
4a2fec |
+ QDECREF(bs_entry->state.explicit_options);
|
|
|
4a2fec |
+ }
|
|
|
4a2fec |
+
|
|
|
4a2fec |
+ bs_entry->state.bs = bs;
|
|
|
4a2fec |
+ bs_entry->state.options = options;
|
|
|
4a2fec |
+ bs_entry->state.explicit_options = explicit_options;
|
|
|
4a2fec |
+ bs_entry->state.flags = flags;
|
|
|
4a2fec |
+
|
|
|
4a2fec |
QLIST_FOREACH(child, &bs->children, next) {
|
|
|
4a2fec |
QDict *new_child_options;
|
|
|
4a2fec |
char *child_key_dot;
|
|
|
4a2fec |
@@ -2786,19 +2799,6 @@ static BlockReopenQueue *bdrv_reopen_queue_child(BlockReopenQueue *bs_queue,
|
|
|
4a2fec |
child->role, options, flags);
|
|
|
4a2fec |
}
|
|
|
4a2fec |
|
|
|
4a2fec |
- if (!bs_entry) {
|
|
|
4a2fec |
- bs_entry = g_new0(BlockReopenQueueEntry, 1);
|
|
|
4a2fec |
- QSIMPLEQ_INSERT_TAIL(bs_queue, bs_entry, entry);
|
|
|
4a2fec |
- } else {
|
|
|
4a2fec |
- QDECREF(bs_entry->state.options);
|
|
|
4a2fec |
- QDECREF(bs_entry->state.explicit_options);
|
|
|
4a2fec |
- }
|
|
|
4a2fec |
-
|
|
|
4a2fec |
- bs_entry->state.bs = bs;
|
|
|
4a2fec |
- bs_entry->state.options = options;
|
|
|
4a2fec |
- bs_entry->state.explicit_options = explicit_options;
|
|
|
4a2fec |
- bs_entry->state.flags = flags;
|
|
|
4a2fec |
-
|
|
|
4a2fec |
return bs_queue;
|
|
|
4a2fec |
}
|
|
|
4a2fec |
|
|
|
4a2fec |
--
|
|
|
4a2fec |
1.8.3.1
|
|
|
4a2fec |
|