From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFoCF-0008OI-Jd for qemu-devel@nongnu.org; Tue, 18 Feb 2014 12:11:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFoC9-0005PB-Jy for qemu-devel@nongnu.org; Tue, 18 Feb 2014 12:11:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFoC9-0005P5-Cm for qemu-devel@nongnu.org; Tue, 18 Feb 2014 12:10:57 -0500 Message-ID: <1392743460.3076.10.camel@localhost.localdomain> From: Marcel Apfelbaum Date: Tue, 18 Feb 2014 19:11:00 +0200 In-Reply-To: <53038F97.6070000@redhat.com> References: <1392741987-6356-1-git-send-email-marcel.a@redhat.com> <53038F97.6070000@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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 Cc: peter.crosthwaite@xilinx.com, mst@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, imammedo@redhat.com, afaerber@suse.de On Tue, 2014-02-18 at 17:51 +0100, Paolo Bonzini wrote: > Il 18/02/2014 17:46, Marcel Apfelbaum ha scritto: > > Sometimes is not enough to get property's value, > > but it is needed to know if the value was actually set. > > > > This is especially useful when querying bool properties > > and having different defaults on different scenarios. > > I think this needs to go together with the use, so that I can understand > what exactly you need. 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." I could send it with QemuMachine QOMify feature, but this will be a fairly large series and I *really* want to minimize it as much as I can, this is why I release small, stand-alone patches, that fixes some issue (see [Qemu-devel] [PATCH] qapi: output visitor crashes qemu if it encounters a NULL value), or adds a fairly useful feature like this one. I understand the downside of adding a feature without using it, but in the same time I want to get maintainers feedback and make my series as small as possible, bigger ones are harder to submit. Thanks for the review! Marcel > > Is it because the bool property is "bool *" and thus cannot be set to > (for example) -1 to indicate the default value? Exactly, but I suppose it can match every property that all its value range is valid. > > Paolo