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

2014-02-18 Thread Marcel Apfelbaum
On Tue, 2014-02-18 at 18:49 +0100, Andreas Färber wrote: > 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 "n

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

2014-02-18 Thread Marcel Apfelbaum
On Tue, 2014-02-18 at 18:26 +0100, Paolo Bonzini wrote: > 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." > > But what would the gette

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

2014-02-18 Thread Andreas Färber
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." > > But what would the getter return in tha

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

2014-02-18 Thread 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." But what would the getter return in that case? If possible, it's better to initialize to the

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

2014-02-18 Thread Marcel Apfelbaum
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

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

2014-02-18 Thread Paolo Bonzini
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 toge

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

2014-02-18 Thread Marcel Apfelbaum
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. Signed-off-by: Marcel Apfelbaum --- include/qom/object.h | 11 +++ qom/o