qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Juan Quintela <quintela@redhat.com>,
	qemu-trivial@nongnu.org, Jan Kiszka <jan.kiszka@siemens.com>,
	Markus Armbruster <armbru@redhat.com>,
	Blue Swirl <blauwirbel@gmail.com>,
	Amit Shah <amit.shah@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v7] qdev: Add support for property type bool
Date: Thu, 26 Jan 2012 16:37:06 +0100	[thread overview]
Message-ID: <4F217322.2000506@suse.de> (raw)
In-Reply-To: <1327591664-18442-1-git-send-email-afaerber@suse.de>

Am 26.01.2012 16:27, schrieb Andreas Färber:
> From: Andreas Färber <andreas.faerber@web.de>
> 
> 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 <andreas.faerber@web.de>
> Cc: Juan Quintela <quintela@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Jan Kiszka <jan.kiszka@siemens.com>
> Cc: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
> ---
>  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

      reply	other threads:[~2012-01-26 15:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-26 15:27 [Qemu-devel] [PATCH v7] qdev: Add support for property type bool Andreas Färber
2012-01-26 15:37 ` Andreas Färber [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F217322.2000506@suse.de \
    --to=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=amit.shah@redhat.com \
    --cc=armbru@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=vasilis.liaskovitis@profitbricks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).