]> git.proxmox.com Git - mirror_qemu.git/commitdiff
handle device help before accelerator set up
authorBruce Rogers <brogers@suse.com>
Thu, 9 Aug 2012 18:47:40 +0000 (12:47 -0600)
committerBlue Swirl <blauwirbel@gmail.com>
Thu, 9 Aug 2012 19:53:01 +0000 (19:53 +0000)
A command line device probe using just -device "?" gets processed
after qemu-kvm initializes the accelerator. If /dev/kvm is not
present, the accelerator check will fail (kvm is defaulted to on),
which causes libvirt to not be set up to handle qemu guests.

Moving the device help handling before the accelerator set up allows
the device probe to work in this configuration and libvirt succeeds
in setting up for a qemu hypervisor mode.

Signed-off-by: Bruce Rogers <brogers@suse.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vl.c

diff --git a/vl.c b/vl.c
index e71cb30ecfc09d89d0cbc9e82585f61b44445083..a4a520fb7e6ce49019ddd5d440e6666784f0710f 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3345,6 +3345,11 @@ int main(int argc, char **argv, char **envp)
         ram_size = DEFAULT_RAM_SIZE * 1024 * 1024;
     }
 
+    if (qemu_opts_foreach(qemu_find_opts("device"), device_help_func, NULL, 0)
+        != 0) {
+        exit(0);
+    }
+
     configure_accelerator();
 
     qemu_init_cpu_loop();
@@ -3500,9 +3505,6 @@ int main(int argc, char **argv, char **envp)
     }
     select_vgahw(vga_model);
 
-    if (qemu_opts_foreach(qemu_find_opts("device"), device_help_func, NULL, 0) != 0)
-        exit(0);
-
     if (watchdog) {
         i = select_watchdog(watchdog);
         if (i > 0)