qemu-devel
[Top][All Lists]
Advanced

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]