From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFonx-0002Q5-BC for qemu-devel@nongnu.org; Tue, 18 Feb 2014 12:50:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFonp-00031H-9j for qemu-devel@nongnu.org; Tue, 18 Feb 2014 12:50:01 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59657 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFonp-00030s-3i for qemu-devel@nongnu.org; Tue, 18 Feb 2014 12:49:53 -0500 Message-ID: <53039D3C.8050802@suse.de> Date: Tue, 18 Feb 2014 18:49:48 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1392741987-6356-1-git-send-email-marcel.a@redhat.com> <53038F97.6070000@redhat.com> <1392743460.3076.10.camel@localhost.localdomain> <530397BD.6090905@redhat.com> In-Reply-To: <530397BD.6090905@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] qom: add object_property_is_set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Marcel Apfelbaum Cc: imammedo@redhat.com, peter.crosthwaite@xilinx.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, mst@redhat.com Am 18.02.2014 18:26, schrieb Paolo Bonzini: > Il 18/02/2014 18:11, Marcel Apfelbaum ha scritto: >> It is used to replace qemu_opt_get_bool that provides a >> parameter for a default value. In this case we need to >> differentiate "no value" from "false." >=20 > But what would the getter return in that case? If possible, it's bette= r > to initialize to the default value in an instance_init method. Another issue I see is that it's currently a valid use case to use a setter in instance_init to set default values. Doing so would flag the property as set with this patch. To me it sounded like a concept similar to component-oriented IDEs where non-default values are shown in bold. We'd need a QMP API for that however, and we'd need to reset properties in instance_post_init to unset then (globals would be considered unset in that case). Another aspect is that dynamic properties are slightly awkward, if we think of setting the rtc, which then advances and reads back differently. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg