All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 6/9] tests/libqos/pci: Clean up string interpolation into QMP input
Date: Fri, 21 Jul 2017 18:50:40 +0200	[thread overview]
Message-ID: <87lgnhag4f.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <c092a949-fd51-93a2-c94a-bed10697efaa@redhat.com> (Eric Blake's message of "Fri, 21 Jul 2017 10:00:02 -0500")

Eric Blake <eblake@redhat.com> writes:

> On 07/21/2017 08:53 AM, Markus Armbruster wrote:
>> Leaving interpolation into JSON to qmp() is more robust than building
>> QMP input manually, as explained in the commit before previous.
>> 
>> The case in qpci_plug_device_test() is a bit complicated: it
>> interpolates several JSON object members, not just a value.  Clean it
>> up by passing them in as QDict rather than string, so we can leave
>> interpolation to qmp() here and to qobject_from_jsonf() in callers.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>
>> 
>> +    response = qmp("{'execute': 'device_add', 'arguments': %p }", args);
>> +
>
> I like this; in fact, in my earlier series attempting to remove
> qobject_from_jsonf(), I heavily relied on %p being useful, to the point
> that I even added a helper function to make it easier (off-hand, it was
> something like qmp_execute(const char *command, QDict *arguments))
>
>> @@ -674,6 +676,7 @@ static void pci_hotplug(void)
>>      if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
>>          qpci_unplug_acpi_device_test("drv1", PCI_SLOT_HP);
>>      }
>> +
>>      qtest_shutdown(qs);
>
> Spurious whitespace addition?

Is it spurious if the result looks better?  ;)

There's a blank line after pci_test_start(), and that makes me want one
before the matching qtest_shutdown().

> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks!

  reply	other threads:[~2017-07-21 16:50 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-21 13:53 [Qemu-devel] [PATCH 0/9] tests: Clean up around qmp() and hmp() Markus Armbruster
2017-07-21 13:53 ` [Qemu-devel] [PATCH 1/9] qtest: Avoid passing raw strings through hmp() Markus Armbruster
2017-07-25 13:56   ` Stefan Hajnoczi
2017-07-21 13:53 ` [Qemu-devel] [PATCH 2/9] qtest: Document calling conventions Markus Armbruster
2017-07-21 14:24   ` Eric Blake
2017-07-21 15:48     ` Markus Armbruster
2017-07-25 13:57   ` Stefan Hajnoczi
2017-07-21 13:53 ` [Qemu-devel] [PATCH 3/9] tests: Pass literal format strings directly to qmp_FOO() Markus Armbruster
2017-07-21 14:26   ` Eric Blake
2017-07-25 13:57   ` Stefan Hajnoczi
2017-07-21 13:53 ` [Qemu-devel] [PATCH 4/9] tests: Clean up string interpolation into QMP input (simple cases) Markus Armbruster
2017-07-21 14:39   ` Eric Blake
2017-07-21 16:48     ` Markus Armbruster
2017-07-21 20:08       ` Eric Blake
2017-07-21 21:15         ` Eric Blake
2017-07-24  8:30         ` Markus Armbruster
2017-07-21 13:53 ` [Qemu-devel] [PATCH 5/9] tests/libqos/usb: Clean up string interpolation into QMP input Markus Armbruster
2017-07-21 14:50   ` Eric Blake
2017-07-21 16:49     ` Markus Armbruster
2017-07-25 14:02   ` Stefan Hajnoczi
2017-07-21 13:53 ` [Qemu-devel] [PATCH 6/9] tests/libqos/pci: " Markus Armbruster
2017-07-21 15:00   ` Eric Blake
2017-07-21 16:50     ` Markus Armbruster [this message]
2017-07-25 14:06   ` Stefan Hajnoczi
2017-07-25 14:10   ` Eric Blake
2017-07-27  8:31     ` Markus Armbruster
2017-07-21 13:53 ` [Qemu-devel] [PATCH 7/9] tests: Clean up wait for event Markus Armbruster
2017-07-21 15:02   ` Eric Blake
2017-07-25 14:08   ` Stefan Hajnoczi
2017-07-21 13:53 ` [Qemu-devel] [PATCH 8/9] tests/libqtest: Clean up how we read the QMP greeting Markus Armbruster
2017-07-21 15:02   ` Eric Blake
2017-07-25 14:08   ` Stefan Hajnoczi
2017-07-21 13:53 ` [Qemu-devel] [PATCH 9/9] tests/libqtest: Enable compile-time format string checking Markus Armbruster
2017-07-21 15:04   ` Eric Blake
2017-07-27  8:36     ` Markus Armbruster
2017-07-25 14:09   ` Stefan Hajnoczi

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=87lgnhag4f.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.