[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/9] tests/libqos/pci: Clean up string interpola
From: |
Markus Armbruster |
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Eric Blake <address@hidden> 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 <address@hidden>
>> ---
>
>>
>> + 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 <address@hidden>
Thanks!
- Re: [Qemu-devel] [PATCH 5/9] tests/libqos/usb: Clean up string interpolation into QMP input, (continued)
- [Qemu-devel] [PATCH 7/9] tests: Clean up wait for event, Markus Armbruster, 2017/07/21
- [Qemu-devel] [PATCH 2/9] qtest: Document calling conventions, Markus Armbruster, 2017/07/21
- [Qemu-devel] [PATCH 6/9] tests/libqos/pci: Clean up string interpolation into QMP input, Markus Armbruster, 2017/07/21
- [Qemu-devel] [PATCH 9/9] tests/libqtest: Enable compile-time format string checking, Markus Armbruster, 2017/07/21
- [Qemu-devel] [PATCH 4/9] tests: Clean up string interpolation into QMP input (simple cases), Markus Armbruster, 2017/07/21