qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Show values and description when using "qom-lis


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] Show values and description when using "qom-list"
Date: Tue, 17 Apr 2018 14:11:40 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 04/16/2018 07:00 AM, Perez Blanco, Ricardo (Nokia - BE/Antwerp) wrote:
> Hi,
> 
> A new patch (to be rebase on top of my previous one). 

A patch-to-a-patch doesn't work well.  Instead, run:

git rebase -i origin

then mark the second patch as 'squash' before closing the editor, and
git will merge the two patches into one.  Then resend things with 'v2'
in the subject line, by using 'git send-email -v2 ...'.

More patch submission hints at https://wiki.qemu.org/Contribute/SubmitAPatch

> 
> From 77f7217c07d5e3892f26082f220954678eb375b3 Mon Sep 17 00:00:00 2001
> From: Ricardo Perez Blanco <address@hidden>
> Date: Mon, 16 Apr 2018 13:51:42 +0200
> Subject: [PATCH] [PATCHv2] Show values and description when using "qom-list"
> 
>     For debugging purposes it is very useful to:

This is not in 'git send-email' format, which makes it harder for our
automated tooling to evaluate your patch.

>      - See the description of the field. This information is already
>        filled
>        in but not shown in "qom-list" command.
>      - Display value of the field. So far, only well known types are
>        implemented (string, str, int, uint, bool).
> 
> Signed-off-by: Ricardo Perez Blanco <address@hidden>
> ---
>  qmp.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/qmp.c b/qmp.c
> index 750b5d0..5be9d8d 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -249,12 +249,14 @@ ObjectPropertyInfoList *qmp_qom_list(const char *path, 
> Error **errp)
>          if (g_ascii_strncasecmp(entry->value->type, "int", 3) == 0) {
>              Error **errp = NULL;
>              entry->value->value = g_strdup_printf("%ld",
> -                object_property_get_int(obj, entry->value->name, errp));
> +                (long int) object_property_get_int(
> +                    obj, entry->value->name, errp));

This is wrong.  Casting 'int64_t' to 'long int' on a 32-bit platform
silently truncates the value.  You don't want the cast; instead, you
should be using "%"PRId64 in place of "%ld", so that your printf format
always matches the correct spelling corresponding to the 64-bit value
you will be printing.


> -----Original Message-----
> From: address@hidden [mailto:address@hidden 
> Sent: Friday, April 13, 2018 2:54 PM
> To: Perez Blanco, Ricardo (Nokia - BE/Antwerp) <address@hidden>
> Cc: address@hidden; address@hidden; address@hidden; address@hidden
> Subject: Re: [Qemu-devel] [PATCH] Show values and description when using 
> "qom-list"
> 
> Hi,
> 

Also, you are top-posting, which makes it hard to follow your
conversation.  On technical lists, it is better to reply inline instead
of top-posting, and to trim content that is not essential to your reply.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]