Blame SOURCES/kvm-vl-Fix-latent-bug-with-global-and-onboard-devices.patch

7711c0
From 55d59dd99ea53889b67956467fb8b25fb57df019 Mon Sep 17 00:00:00 2001
7711c0
From: Markus Armbruster <armbru@redhat.com>
7711c0
Date: Fri, 17 May 2019 06:51:09 +0200
7711c0
Subject: [PATCH 42/53] vl: Fix latent bug with -global and onboard devices
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-21-armbru@redhat.com>
7711c0
Patchwork-id: 87991
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH v3 20/31] vl: Fix latent bug with -global and onboard devices
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
main() registers the user's -global only after we create the machine
7711c0
object, i.e. too late for devices created in the machine's
7711c0
.instance_init().
7711c0
7711c0
Fortunately, we know the bug is only latent: the commit before
7711c0
previous fixed a bug that would've crashed any attempt to create a
7711c0
device in an .instance_init().
7711c0
7711c0
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7711c0
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7711c0
Message-Id: <20190308131445.17502-4-armbru@redhat.com>
7711c0
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
7711c0
(cherry picked from commit fc4a473482d595da08ae20ce239f0b62fa55d0f2)
7711c0
[The commit message's "we know the bug is only latent" part doesn't
7711c0
apply downstream]
7711c0
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 vl.c | 19 ++-----------------
7711c0
 1 file changed, 2 insertions(+), 17 deletions(-)
7711c0
7711c0
diff --git a/vl.c b/vl.c
7711c0
index 72c489f..d46dff6 100644
7711c0
--- a/vl.c
7711c0
+++ b/vl.c
7711c0
@@ -3052,17 +3052,6 @@ static void user_register_global_props(void)
7711c0
                       global_init_func, NULL, NULL);
7711c0
 }
7711c0
 
7711c0
-/*
7711c0
- * Note: we should see that these properties are actually having a
7711c0
- * priority: accel < machine < user. This means e.g. when user
7711c0
- * specifies something in "-global", it'll always be used with highest
7711c0
- * priority than either machine/accelerator compat properties.
7711c0
- */
7711c0
-static void register_global_properties(MachineState *ms)
7711c0
-{
7711c0
-    user_register_global_props();
7711c0
-}
7711c0
-
7711c0
 int main(int argc, char **argv, char **envp)
7711c0
 {
7711c0
     int i;
7711c0
@@ -4119,6 +4108,8 @@ int main(int argc, char **argv, char **envp)
7711c0
      */
7711c0
     loc_set_none();
7711c0
 
7711c0
+    user_register_global_props();
7711c0
+
7711c0
     replay_configure(icount_opts);
7711c0
 
7711c0
     /* Maximum number of CPUs limited for Red Hat Enterprise Linux */
7711c0
@@ -4438,12 +4429,6 @@ int main(int argc, char **argv, char **envp)
7711c0
     configure_accelerator(current_machine);
7711c0
 
7711c0
     /*
7711c0
-     * Register all the global properties, including accel properties,
7711c0
-     * machine properties, and user-specified ones.
7711c0
-     */
7711c0
-    register_global_properties(current_machine);
7711c0
-
7711c0
-    /*
7711c0
      * Migration object can only be created after global properties
7711c0
      * are applied correctly.
7711c0
      */
7711c0
-- 
7711c0
1.8.3.1
7711c0