qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 07/12] qapi: add human mode to StringOutputVisit


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 07/12] qapi: add human mode to StringOutputVisitor
Date: Mon, 10 Feb 2014 18:57:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

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.
> 
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  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(-)
> 
> 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 @@
>  
>  typedef struct StringOutputVisitor StringOutputVisitor;
>  
> -StringOutputVisitor *string_output_visitor_new(void);
> +StringOutputVisitor *string_output_visitor_new(bool human);
>  void string_output_visitor_cleanup(StringOutputVisitor *v);
>  
>  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 char 
> *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);
>  
>  /**
[snip]

-- 
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]