qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qom: add object_property_is_set


From: Marcel Apfelbaum
Subject: Re: [Qemu-devel] [PATCH] qom: add object_property_is_set
Date: Tue, 18 Feb 2014 19:11:00 +0200

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]