Received: from eggs.gnu.org ([208.118.235.92]:44577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQch3-0004gt-Li for qemu-devel@nongnu.org; Tue, 23 Oct 2012 07:30:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQcgx-0007Qw-TS for qemu-devel@nongnu.org; Tue, 23 Oct 2012 07:30:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQcgx-0007Qq-LY for qemu-devel@nongnu.org; Tue, 23 Oct 2012 07:30:39 -0400 From: Markus Armbruster References: <1350329657-18665-1-git-send-email-aliguori@us.ibm.com> <1350329657-18665-2-git-send-email-aliguori@us.ibm.com> Date: Tue, 23 Oct 2012 13:30:33 +0200 In-Reply-To: <1350329657-18665-2-git-send-email-aliguori@us.ibm.com> (Anthony Liguori's message of "Mon, 15 Oct 2012 14:34:12 -0500") Message-ID: <87vce1xw6e.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 1/6] object: add object_property_add_bool List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , qemu-devel@nongnu.org, Andreas Faerber , Gerd Hoffmann Anthony Liguori writes: > Signed-off-by: Anthony Liguori > --- > include/qemu/object.h | 17 ++++++++++++++ > qom/object.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 75 insertions(+), 0 deletions(-) > > diff --git a/include/qemu/object.h b/include/qemu/object.h > index cc75fee..f4dc2ea 100644 > --- a/include/qemu/object.h > +++ b/include/qemu/object.h > @@ -947,6 +947,23 @@ void object_property_add_str(Object *obj, const char *name, > struct Error **errp); > > /** > + * object_property_add_bool: > + * @obj: the object to add a property to > + * @name: the name of the property > + * @get: the getter or NULL if the property is write-only. This function must > + * return a string to be freed by g_free(). Pasto. It returns a bool. > + * @set: the setter or NULL if the property is read-only > + * @errp: if an error occurs, a pointer to an area to store the error > + * > + * Add a bool property using getters/setters. This function will add a > + * property of type 'bool'. > + */ > +void object_property_add_bool(Object *obj, const char *name, > + bool (*get)(Object *, struct Error **), > + void (*set)(Object *, bool, struct Error **), > + struct Error **errp); > + > +/** > * object_child_foreach: > * @obj: the object whose children will be navigated > * @fn: the iterator function to be called [...]