Blame SOURCES/kvm-vl-Create-block-backends-before-setting-machine-prop.patch

383d26
From ae3fa9b069ad0e99fda95a34b18c68effe576f85 Mon Sep 17 00:00:00 2001
383d26
From: Markus Armbruster <armbru@redhat.com>
383d26
Date: Fri, 17 May 2019 06:51:13 +0200
383d26
Subject: [PATCH 46/53] vl: Create block backends before setting machine
383d26
 properties
383d26
MIME-Version: 1.0
383d26
Content-Type: text/plain; charset=UTF-8
383d26
Content-Transfer-Encoding: 8bit
383d26
383d26
RH-Author: Markus Armbruster <armbru@redhat.com>
383d26
Message-id: <20190517065120.12028-25-armbru@redhat.com>
383d26
Patchwork-id: 87985
383d26
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH v3 24/31] vl: Create block backends before setting machine properties
383d26
Bugzilla: 1624009
383d26
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
383d26
RH-Acked-by: Thomas Huth <thuth@redhat.com>
383d26
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
383d26
qemu-system-FOO's main() acts on command line arguments in its own
383d26
idiosyncratic order.  There's not much method to its madness.
383d26
Whenever we find a case where one kind of command line argument needs
383d26
to refer to something created for another kind later, we rejigger the
383d26
order.
383d26
383d26
Block devices get created long after machine properties get processed.
383d26
Therefore, block device machine properties can be created, but not
383d26
set.  No such properties exist.  But the next commit will create some.
383d26
Time to rejigger again: create block devices earlier.
383d26
383d26
Signed-off-by: Markus Armbruster <armbru@redhat.com>
383d26
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
383d26
Message-Id: <20190308131445.17502-8-armbru@redhat.com>
383d26
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
383d26
(cherry picked from commit cda4aa9a5a08777cf13e164c0543bd4888b8adce)
383d26
[Trivial conflict in vl.c due to lack of commit 2d5a3a8b02a]
383d26
383d26
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
---
383d26
 vl.c | 9 +++++++--
383d26
 1 file changed, 7 insertions(+), 2 deletions(-)
383d26
383d26
diff --git a/vl.c b/vl.c
383d26
index e0e60fb..15e87a4 100644
383d26
--- a/vl.c
383d26
+++ b/vl.c
383d26
@@ -4465,6 +4465,13 @@ int main(int argc, char **argv, char **envp)
383d26
         exit(0);
383d26
     }
383d26
 
383d26
+    /*
383d26
+     * Note: we need to create block backends before
383d26
+     * machine_set_property(), so machine properties can refer to
383d26
+     * them.
383d26
+     */
383d26
+    configure_blockdev(&bdo_queue, machine_class, snapshot);
383d26
+
383d26
     machine_opts = qemu_get_machine_opts();
383d26
     if (qemu_opt_foreach(machine_opts, machine_set_property, current_machine,
383d26
                          NULL)) {
383d26
@@ -4590,8 +4597,6 @@ int main(int argc, char **argv, char **envp)
383d26
     ram_mig_init();
383d26
     dirty_bitmap_mig_init();
383d26
 
383d26
-    configure_blockdev(&bdo_queue, machine_class, snapshot);
383d26
-
383d26
     if (qemu_opts_foreach(qemu_find_opts("mon"),
383d26
                           mon_init_func, NULL, NULL)) {
383d26
         exit(1);
383d26
-- 
383d26
1.8.3.1
383d26