Skip to contentSkip to conversation

vl: process -object after other backend options

PATCH In review Paolo Bonzini 2 participants 3 messages Aug 25, 2014 – Aug 27, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vl: process -object after other backend options

QOM backends can refer to chardevs, but not vice versa. So process -chardev and -fsdev options before -object

This fixes the rng-egd backend to virtio-rng.

---
 vl.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
vl.c +5 -5
index b796c67..1d8eb27 100644
@@ -4033,11 +4033,6 @@ int main(int argc, char **argv, char **envp)
         qemu_set_version(machine_class->hw_version);
     }
 
-    if (qemu_opts_foreach(qemu_find_opts("object"),
-                          object_create, NULL, 0) != 0) {
-        exit(1);
-    }
-
     /* Init CPU def lists, based on config
      * - Must be called after all the qemu_read_config_file() calls
      * - Must be called before list_cpus()
@@ -4256,6 +4251,11 @@ int main(int argc, char **argv, char **envp)
         exit(1);
     }
 
+    if (qemu_opts_foreach(qemu_find_opts("object"),
+                          object_create, NULL, 0) != 0) {
+        exit(1);
+    }
+
     configure_accelerator(machine_class);
 
     if (qtest_chrdev) {
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 11 lines · Paolo Bonzini

QOM backends can refer to chardevs, but not vice versa. So process -chardev and -fsdev options before -object

This fixes the rng-egd backend to virtio-rng.

---
 vl.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Option ordering is a bad idea. With an option as generic as -object, who can say that there will never be a non-object that depends on an -object?

We should process the command-line left-to-right instead of ordering by option type. Maybe that would be a good QEMU 3.0 feature! :)

Feel free to merge if it works for now, but we'll need a better fix in the future.

Stefan

#2 lore raw

Il 27/08/2014 15:34, Stefan Hajnoczi ha scritto:

Quoted 9 lines

Option ordering is a bad idea. With an option as generic as -object, who can say that there will never be a non-object that depends on an -object?

We should process the command-line left-to-right instead of ordering by option type. Maybe that would be a good QEMU 3.0 feature! :)

Feel free to merge if it works for now, but we'll need a better fix in the future.

I agree on all points.

Paolo