|
|
7711c0 |
From edb07556033d42de5dc065d03aef2ea1ae663d8d Mon Sep 17 00:00:00 2001
|
|
|
7711c0 |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
7711c0 |
Date: Fri, 17 May 2019 06:51:11 +0200
|
|
|
7711c0 |
Subject: [PATCH 44/53] vl: Improve legibility of BlockdevOptions queue
|
|
|
7711c0 |
MIME-Version: 1.0
|
|
|
7711c0 |
Content-Type: text/plain; charset=UTF-8
|
|
|
7711c0 |
Content-Transfer-Encoding: 8bit
|
|
|
7711c0 |
|
|
|
7711c0 |
RH-Author: Markus Armbruster <armbru@redhat.com>
|
|
|
7711c0 |
Message-id: <20190517065120.12028-23-armbru@redhat.com>
|
|
|
7711c0 |
Patchwork-id: 87992
|
|
|
7711c0 |
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH v3 22/31] vl: Improve legibility of BlockdevOptions queue
|
|
|
7711c0 |
Bugzilla: 1624009
|
|
|
7711c0 |
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
Give the queue head type a name: BlockdevOptionsQueue.
|
|
|
7711c0 |
|
|
|
7711c0 |
Rename the queue entry type from BlockdevOptions_queue to
|
|
|
7711c0 |
BlockdevOptionsQueueEntry.
|
|
|
7711c0 |
|
|
|
7711c0 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
7711c0 |
Message-Id: <20190308131445.17502-6-armbru@redhat.com>
|
|
|
7711c0 |
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
7711c0 |
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
7711c0 |
(cherry picked from commit 651af51c0882a4c60704716819878043c1b8a215)
|
|
|
7711c0 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
---
|
|
|
7711c0 |
vl.c | 22 ++++++++++++----------
|
|
|
7711c0 |
1 file changed, 12 insertions(+), 10 deletions(-)
|
|
|
7711c0 |
|
|
|
7711c0 |
diff --git a/vl.c b/vl.c
|
|
|
7711c0 |
index d89ac3a..a5c17a0 100644
|
|
|
7711c0 |
--- a/vl.c
|
|
|
7711c0 |
+++ b/vl.c
|
|
|
7711c0 |
@@ -1271,6 +1271,14 @@ static void default_drive(int enable, int snapshot, BlockInterfaceType type,
|
|
|
7711c0 |
|
|
|
7711c0 |
}
|
|
|
7711c0 |
|
|
|
7711c0 |
+typedef struct BlockdevOptionsQueueEntry {
|
|
|
7711c0 |
+ BlockdevOptions *bdo;
|
|
|
7711c0 |
+ Location loc;
|
|
|
7711c0 |
+ QSIMPLEQ_ENTRY(BlockdevOptionsQueueEntry) entry;
|
|
|
7711c0 |
+} BlockdevOptionsQueueEntry;
|
|
|
7711c0 |
+
|
|
|
7711c0 |
+typedef QSIMPLEQ_HEAD(, BlockdevOptionsQueueEntry) BlockdevOptionsQueue;
|
|
|
7711c0 |
+
|
|
|
7711c0 |
static QemuOptsList qemu_smp_opts = {
|
|
|
7711c0 |
.name = "smp-opts",
|
|
|
7711c0 |
.implied_opt_name = "cpus",
|
|
|
7711c0 |
@@ -3087,13 +3095,7 @@ int main(int argc, char **argv, char **envp)
|
|
|
7711c0 |
Error *err = NULL;
|
|
|
7711c0 |
bool list_data_dirs = false;
|
|
|
7711c0 |
char *dir, **dirs;
|
|
|
7711c0 |
- typedef struct BlockdevOptions_queue {
|
|
|
7711c0 |
- BlockdevOptions *bdo;
|
|
|
7711c0 |
- Location loc;
|
|
|
7711c0 |
- QSIMPLEQ_ENTRY(BlockdevOptions_queue) entry;
|
|
|
7711c0 |
- } BlockdevOptions_queue;
|
|
|
7711c0 |
- QSIMPLEQ_HEAD(, BlockdevOptions_queue) bdo_queue
|
|
|
7711c0 |
- = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
|
|
|
7711c0 |
+ BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
|
|
|
7711c0 |
|
|
|
7711c0 |
module_call_init(MODULE_INIT_TRACE);
|
|
|
7711c0 |
|
|
|
7711c0 |
@@ -3224,7 +3226,7 @@ int main(int argc, char **argv, char **envp)
|
|
|
7711c0 |
case QEMU_OPTION_blockdev:
|
|
|
7711c0 |
{
|
|
|
7711c0 |
Visitor *v;
|
|
|
7711c0 |
- BlockdevOptions_queue *bdo;
|
|
|
7711c0 |
+ BlockdevOptionsQueueEntry *bdo;
|
|
|
7711c0 |
|
|
|
7711c0 |
v = qobject_input_visitor_new_str(optarg, "driver", &err;;
|
|
|
7711c0 |
if (!v) {
|
|
|
7711c0 |
@@ -3232,7 +3234,7 @@ int main(int argc, char **argv, char **envp)
|
|
|
7711c0 |
exit(1);
|
|
|
7711c0 |
}
|
|
|
7711c0 |
|
|
|
7711c0 |
- bdo = g_new(BlockdevOptions_queue, 1);
|
|
|
7711c0 |
+ bdo = g_new(BlockdevOptionsQueueEntry, 1);
|
|
|
7711c0 |
visit_type_BlockdevOptions(v, NULL, &bdo->bdo,
|
|
|
7711c0 |
&error_fatal);
|
|
|
7711c0 |
visit_free(v);
|
|
|
7711c0 |
@@ -4557,7 +4559,7 @@ int main(int argc, char **argv, char **envp)
|
|
|
7711c0 |
|
|
|
7711c0 |
/* open the virtual block devices */
|
|
|
7711c0 |
while (!QSIMPLEQ_EMPTY(&bdo_queue)) {
|
|
|
7711c0 |
- BlockdevOptions_queue *bdo = QSIMPLEQ_FIRST(&bdo_queue);
|
|
|
7711c0 |
+ BlockdevOptionsQueueEntry *bdo = QSIMPLEQ_FIRST(&bdo_queue);
|
|
|
7711c0 |
|
|
|
7711c0 |
QSIMPLEQ_REMOVE_HEAD(&bdo_queue, entry);
|
|
|
7711c0 |
loc_push_restore(&bdo->loc);
|
|
|
7711c0 |
--
|
|
|
7711c0 |
1.8.3.1
|
|
|
7711c0 |
|