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: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] qom: add object_property_is_set
Date: Tue, 18 Feb 2014 18:49:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

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 that case?  If possible, it's better
> 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

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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