[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH v7] qdev: Add support for propert
From: |
Andreas Färber |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH v7] qdev: Add support for property type bool |
Date: |
Thu, 26 Jan 2012 16:37:06 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0 |
Am 26.01.2012 16:27, schrieb Andreas Färber:
> From: Andreas Färber <address@hidden>
>
> VMState supports the type bool but qdev instead supports bit, backed by
> uint32_t. Therefore let's add PROP_TYPE_BOOL and qdev_prop_set_bool().
>
> With non-programmers in mind, instead of universal true/false provide
> two different property types:
> * on/off for DEFINE_PROP_SWITCH() (requested by Jan) and
> * yes/no for DEFINE_PROP_BOOL() (also accepting true/false as input).
>
> Signed-off-by: Andreas Färber <address@hidden>
> Cc: Juan Quintela <address@hidden>
> Cc: Markus Armbruster <address@hidden>
> Cc: Jan Kiszka <address@hidden>
> Cc: Vasilis Liaskovitis <address@hidden>
> ---
> v6 -> v7:
> * Rename existing "boolean" type to "bit".
> * Re-introduce qdev_prop_set_bool().
> * Split "bool" into "switch" (on/off) and "boolean" (yes/no; true/false
> input).
>
> v5 -> v6:
> * Rebased onto QOM properties.
> * Parse and print true/false for bool, leave bit untouched.
> Please review, v6 untested.
> [* Accidentally dropped qdev_prop_set_bool().]
>
> v4 -> v5 (40P):
> * Parse on/off in addition to yes/no for both bit and bool, print yes/no for
> bool.
>
> v4 (ISA):
> * Introduced.
>
> hw/qdev-properties.c | 102
> +++++++++++++++++++++++++++++++++++++++++++++++++-
> hw/qdev.h | 7 +++
> 2 files changed, 108 insertions(+), 1 deletions(-)
> diff --git a/hw/qdev.h b/hw/qdev.h
> index 6b58dd8..37167d4 100644
> --- a/hw/qdev.h
> +++ b/hw/qdev.h
> @@ -152,6 +152,7 @@ enum PropertyType {
> PROP_TYPE_VLAN,
> PROP_TYPE_PTR,
> PROP_TYPE_BIT,
> + PROP_TYPE_BOOL,
> };
>
> struct PropertyInfo {
> @@ -276,6 +277,7 @@ int do_device_del(Monitor *mon, const QDict *qdict,
> QObject **ret_data);
> /*** qdev-properties.c ***/
>
> extern PropertyInfo qdev_prop_bit;
> +extern PropertyInfo qdev_prop_bool;
Sorry, missing
extern PropertyInfo qdev_prop_bool_switch;
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg