All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Perez Blanco,
	Ricardo (Nokia - BE/Antwerp)" <ricardo.perez_blanco@nokia.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "famz@redhat.com" <famz@redhat.com>,
	"dgilbert@redhat.com" <dgilbert@redhat.com>,
	"armbru@redhat.com" <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Show values and description when using "qom-list"
Date: Tue, 17 Apr 2018 14:11:40 -0500	[thread overview]
Message-ID: <c06b13a1-e838-e86a-03f9-a5304080c888@redhat.com> (raw)
In-Reply-To: <AM3PR07MB273FE7C1A9E51037C029754B3B00@AM3PR07MB273.eurprd07.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2977 bytes --]

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 <ricardo.perez_blanco@nokia.com>
> 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 <ricardo.perez_blanco@nokia.com>
> ---
>  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: no-reply@patchew.org [mailto:no-reply@patchew.org] 
> Sent: Friday, April 13, 2018 2:54 PM
> To: Perez Blanco, Ricardo (Nokia - BE/Antwerp) <ricardo.perez_blanco@nokia.com>
> Cc: famz@redhat.com; qemu-devel@nongnu.org; dgilbert@redhat.com; armbru@redhat.com
> 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

  reply	other threads:[~2018-04-17 19:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-13  8:05 [Qemu-devel] [PATCH] Show values and description when using "qom-list" Perez Blanco, Ricardo (Nokia - BE/Antwerp)
2018-04-13 12:53 ` no-reply
2018-04-16 12:00   ` Perez Blanco, Ricardo (Nokia - BE/Antwerp)
2018-04-17 19:11     ` Eric Blake [this message]
2018-04-17 19:19 ` Eric Blake
2018-04-19  3:51 ` QingFeng Hao
2018-04-24 11:49   ` Dr. David Alan Gilbert
2018-04-24 12:17     ` Perez Blanco, Ricardo (Nokia - BE/Antwerp)
2018-04-25  0:38     ` QingFeng Hao

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=c06b13a1-e838-e86a-03f9-a5304080c888@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ricardo.perez_blanco@nokia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.