qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vl: process -object after other backend options
@ 2014-08-25 12:17 Paolo Bonzini
  2014-08-27 13:34 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2014-08-25 12:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: imammedo, akong, qemu-stable

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.

Reported-by: Amos Kong <akong@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 vl.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/vl.c b/vl.c
index b796c67..1d8eb27 100644
--- a/vl.c
+++ b/vl.c
@@ -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) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] vl: process -object after other backend options
  2014-08-25 12:17 [Qemu-devel] [PATCH] vl: process -object after other backend options Paolo Bonzini
@ 2014-08-27 13:34 ` Stefan Hajnoczi
  2014-08-27 13:38   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-08-27 13:34 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: imammedo, akong, qemu-devel, qemu-stable

[-- Attachment #1: Type: text/plain, Size: 839 bytes --]

On Mon, Aug 25, 2014 at 02:17:04PM +0200, Paolo Bonzini wrote:
> 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.
> 
> Reported-by: Amos Kong <akong@redhat.com>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  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

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] vl: process -object after other backend options
  2014-08-27 13:34 ` Stefan Hajnoczi
@ 2014-08-27 13:38   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2014-08-27 13:38 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: imammedo, akong, qemu-devel, qemu-stable

Il 27/08/2014 15:34, Stefan Hajnoczi ha scritto:
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-27 13:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-25 12:17 [Qemu-devel] [PATCH] vl: process -object after other backend options Paolo Bonzini
2014-08-27 13:34 ` Stefan Hajnoczi
2014-08-27 13:38   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).