From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKPqy-0006n1-8B for qemu-devel@nongnu.org; Mon, 03 Mar 2014 05:12:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKPqp-0002SI-Rp for qemu-devel@nongnu.org; Mon, 03 Mar 2014 05:12:08 -0500 Received: from mail-qg0-x230.google.com ([2607:f8b0:400d:c04::230]:58686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKPqp-0002Rw-NL for qemu-devel@nongnu.org; Mon, 03 Mar 2014 05:11:59 -0500 Received: by mail-qg0-f48.google.com with SMTP id a108so10790794qge.7 for ; Mon, 03 Mar 2014 02:11:59 -0800 (PST) Sender: Paolo Bonzini Message-ID: <53145568.50108@redhat.com> Date: Mon, 03 Mar 2014 11:11:52 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1393765632-2753-1-git-send-email-marcel.a@redhat.com> <1393765632-2753-7-git-send-email-marcel.a@redhat.com> In-Reply-To: <1393765632-2753-7-git-send-email-marcel.a@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC V2 6/9] vl.c: do not set 'type' property in obj_set_property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, blauwirbel@gmail.com, mdroth@linux.vnet.ibm.com, mst@redhat.com, armbru@redhat.com, mtosatti@redhat.com, agraf@suse.de, ehabkost@redhat.com, lcapitulino@redhat.com, peter.crosthwaite@petalogix.com, quintela@redhat.com, aliguori@amazon.com, imammedo@redhat.com, scottwood@freescale.com, edgar.iglesias@gmail.com, afaerber@suse.de, rth@twiddle.net 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 > --- > 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