[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-3.2 3/7] ahci-test: Drop dependence on globa
From: |
John Snow |
Subject: |
Re: [Qemu-devel] [PATCH for-3.2 3/7] ahci-test: Drop dependence on global_qtest |
Date: |
Tue, 13 Nov 2018 19:10:18 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
On 11/12/18 2:08 PM, Thomas Huth wrote:
> From: Eric Blake <address@hidden>
>
> Managing parallel connections to two different monitors via
> the implicit global_qtest makes it hard to copy-and-paste code
> to tests that are not aware of the implicit state; the
> management of global_qtest is even harder to follow because
> it was masked behind set_context().
>
> Instead, explicitly pass QTestState* around (generally, by
> reusing the member already present in ahci->parent QOSState),
> and call explicit qtest_* functions on all places that
> interact with a monitor.
>
> We can assert that the conversion is correct by checking that
> global_qtest remains NULL throughout the test (a later patch
> that changes global_qtest to not be a public global variable
> will drop the assertions).
>
> Bonus: there was one spots that was creating a needless temporary
> variable to execute the 'cont' command, rather than just directly
> passing the literal command through qtest_qmp(). Fixing that
> gets us one step closer to enabling -Wformat checking on
> constructed JSON.
>
> Signed-off-by: Eric Blake <address@hidden>
> [thuth: rebased patch to current master branch]
> Signed-off-by: Thomas Huth <address@hidden>
This one's from a while back!
Acked-by: John Snow <address@hidden>
- [Qemu-devel] [PATCH v1 for-3.2 0/7] Get rid of global_qtest in some of the qtests, Thomas Huth, 2018/11/12
- [Qemu-devel] [PATCH for-3.2 3/7] ahci-test: Drop dependence on global_qtest, Thomas Huth, 2018/11/12
- [Qemu-devel] [PATCH for-3.2 1/7] tests/pvpanic: Make the pvpanic test independent of global_qtest, Thomas Huth, 2018/11/12
- [Qemu-devel] [PATCH for-3.2 7/7] tests/boot-serial: Get rid of global_qtest variable, Thomas Huth, 2018/11/12
- [Qemu-devel] [PATCH for-3.2 6/7] tests/vmgenid: Make test independent of global_qtest, Thomas Huth, 2018/11/12
- [Qemu-devel] [PATCH for-3.2 2/7] tests/libqos/pci: Make PCI access functions independent of global_qtest, Thomas Huth, 2018/11/12
- [Qemu-devel] [PATCH for-3.2 5/7] tests/acpi-utils: Drop dependence on global_qtest, Thomas Huth, 2018/11/12