From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCv6j-0005R1-A5 for qemu-devel@nongnu.org; Mon, 10 Feb 2014 12:57:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCv6b-0002ei-S4 for qemu-devel@nongnu.org; Mon, 10 Feb 2014 12:57:25 -0500 Received: from cantor2.suse.de ([195.135.220.15]:46541 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCv6b-0002eZ-LS for qemu-devel@nongnu.org; Mon, 10 Feb 2014 12:57:17 -0500 Message-ID: <52F912F9.8050400@suse.de> Date: Mon, 10 Feb 2014 18:57:13 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1391087394-17914-1-git-send-email-pbonzini@redhat.com> <1391087394-17914-8-git-send-email-pbonzini@redhat.com> In-Reply-To: <1391087394-17914-8-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 07/12] qapi: add human mode to StringOutputVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: armbru@redhat.com Am 30.01.2014 14:09, schrieb Paolo Bonzini: > This will be used by "info qtree". For numbers it prints both the > decimal and hex values. For sizes it rounds to the nearest power > of 2^10. For strings, it puts quotes around the string and separates > NULL and empty string. >=20 > Signed-off-by: Paolo Bonzini > --- > include/qapi/string-output-visitor.h | 2 +- > include/qom/object.h | 3 +- > qapi/string-output-visitor.c | 55 ++++++++++++++++++++++++++++= ++++++-- > qdev-monitor.c | 2 +- > qom/object.c | 4 +-- > tests/test-string-output-visitor.c | 2 +- > tests/test-visitor-serialization.c | 2 +- > 7 files changed, 60 insertions(+), 10 deletions(-) >=20 > diff --git a/include/qapi/string-output-visitor.h b/include/qapi/string= -output-visitor.h > index ec81e42..d99717f 100644 > --- a/include/qapi/string-output-visitor.h > +++ b/include/qapi/string-output-visitor.h > @@ -17,7 +17,7 @@ > =20 > typedef struct StringOutputVisitor StringOutputVisitor; > =20 > -StringOutputVisitor *string_output_visitor_new(void); > +StringOutputVisitor *string_output_visitor_new(bool human); > void string_output_visitor_cleanup(StringOutputVisitor *v); > =20 > char *string_output_get_string(StringOutputVisitor *v); > diff --git a/include/qom/object.h b/include/qom/object.h > index e0ff212..9c7c361 100644 > --- a/include/qom/object.h > +++ b/include/qom/object.h > @@ -946,12 +946,13 @@ void object_property_parse(Object *obj, const cha= r *string, > * object_property_print: > * @obj: the object > * @name: the name of the property > + * @human: if true, print for human consumption This would ideally be %true, but I better not fiddle with that to not create merge conflicts, so hoping it can be fixed in the follow-up. Andreas > * @errp: returns an error if this function fails > * > * Returns a string representation of the value of the property. The > * caller shall free the string. > */ > -char *object_property_print(Object *obj, const char *name, > +char *object_property_print(Object *obj, const char *name, bool human, > Error **errp); > =20 > /** [snip] --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg