qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC V2 6/9] vl.c: do not set 'type' property in


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH RFC V2 6/9] vl.c: do not set 'type' property in obj_set_property
Date: Mon, 03 Mar 2014 11:11:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Il 02/03/2014 14:07, Marcel Apfelbaum ha scritto:
Filter out also 'type' property when setting
object's properties

Signed-off-by: Marcel Apfelbaum <address@hidden>
---
 vl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vl.c b/vl.c
index c4939ef..dc206e1 100644
--- a/vl.c
+++ b/vl.c
@@ -2766,7 +2766,8 @@ static int object_set_property(const char *name, const 
char *value, void *opaque
     StringInputVisitor *siv;
     Error *local_err = NULL;

-    if (strcmp(name, "qom-type") == 0 || strcmp(name, "id") == 0) {
+    if (strcmp(name, "qom-type") == 0 || strcmp(name, "id") == 0 ||
+        strcmp(name, "type") == 0) {
         return 0;
     }



Unfortunately, it is quite possible to have a -object invocation where the object has a "type" property.

I think you could change the -object implementation to use OptsVisitor, similar to hmp_object_add in hmp.c. Then the -object code can pre-parse "qom-type" and "id", while the -machine code can pre-parse "type".

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]