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