From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKRgf-00041O-Ui for qemu-devel@nongnu.org; Mon, 03 Mar 2014 07:09:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKRgZ-0005dC-WE for qemu-devel@nongnu.org; Mon, 03 Mar 2014 07:09:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKRgZ-0005d3-ML for qemu-devel@nongnu.org; Mon, 03 Mar 2014 07:09:31 -0500 Message-ID: <1393848578.3882.6.camel@localhost.localdomain> From: Marcel Apfelbaum Date: Mon, 03 Mar 2014 14:09:38 +0200 In-Reply-To: <53145568.50108@redhat.com> References: <1393765632-2753-1-git-send-email-marcel.a@redhat.com> <1393765632-2753-7-git-send-email-marcel.a@redhat.com> <53145568.50108@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 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: Paolo Bonzini 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, qemu-devel@nongnu.org, peter.crosthwaite@petalogix.com, quintela@redhat.com, aliguori@amazon.com, imammedo@redhat.com, scottwood@freescale.com, edgar.iglesias@gmail.com, lcapitulino@redhat.com, afaerber@suse.de, rth@twiddle.net On Mon, 2014-03-03 at 11:11 +0100, Paolo Bonzini wrote: > 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. Thanks, I was thinking that "type" is a built-in property of the Object, derived directly from class's type, so no one can "set" this 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". I'll look into it, thanks for the tip. Thanks, Marcel > > Paolo