From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wkyg7-0006Qs-Fh for qemu-devel@nongnu.org; Thu, 15 May 2014 12:38:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wkyfx-0004jI-ST for qemu-devel@nongnu.org; Thu, 15 May 2014 12:38:43 -0400 Message-ID: <5374ED83.4030909@suse.de> Date: Thu, 15 May 2014 18:38:27 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1399473780-20374-1-git-send-email-marcel.a@redhat.com> <1399473780-20374-4-git-send-email-marcel.a@redhat.com> <87ha4rqapw.fsf@blackfin.pond.sub.org> In-Reply-To: <87ha4rqapw.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/4] vl.c: do not set 'type' property in obj_set_property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Marcel Apfelbaum Cc: mst@redhat.com, aik@ozlabs.ru, qemu-devel@nongnu.org, lcapitulino@redhat.com, blauwirbel@gmail.com, jcmvbkbc@gmail.com, edgar.iglesias@gmail.com, gxt@mprc.pku.edu.cn, peter.chubb@nicta.com.au, proljc@gmail.com, agraf@suse.de, scottwood@freescale.com, borntraeger@de.ibm.com, hpoussin@reactos.org, aliguori@amazon.com, lersek@redhat.com, mdroth@linux.vnet.ibm.com, chouteau@adacore.com, jan.kiszka@web.de, stefanha@redhat.com, cornelia.huck@de.ibm.com, peter.crosthwaite@xilinx.com, mark.langsdorf@calxeda.com, michael@walle.cc, qemu-ppc@nongnu.org, pbonzini@redhat.com, aurelien@aurel32.net Am 15.05.2014 18:15, schrieb Markus Armbruster: > Marcel Apfelbaum writes: >=20 >> Filter out also 'type' property when setting >> object's properties >> >> Reviewed-by: Paolo Bonzini >> Signed-off-by: Marcel Apfelbaum >> --- >> vl.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/vl.c b/vl.c >> index 58673bd..6ec6c1a 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -2889,7 +2889,8 @@ static int object_set_property(const char *name,= const char *value, void *opaque >> StringInputVisitor *siv; >> Error *local_err =3D NULL; >> =20 >> - if (strcmp(name, "qom-type") =3D=3D 0 || strcmp(name, "id") =3D=3D= 0) { >> + if (strcmp(name, "qom-type") =3D=3D 0 || strcmp(name, "id") =3D=3D= 0 || >> + strcmp(name, "type") =3D=3D 0) { >> return 0; >> } >=20 > I can see why "id" and "qom-type" need to be filtered out: they're > consumed by object_create() before object_set_property() gets called. >=20 > I can't see why "type". Explain? My understanding is, -machine [type=3D]name[,...] coincides with every Object exposing a read-only property "type". Not only would setting it fail, but the values differ (display name vs. unique type name). On that matter, our help output does not seem to indicate the name of the corresponding -object parameter, my unverified guess is that that is called "qom-type". OTOH there's no reason to suppress "qom-type" or "id" for -machine, as implied when I suggested using a separate function. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg