[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on globa
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on global_qtest |
Date: |
Wed, 23 Aug 2017 16:30:12 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 08/23/2017 03:02 PM, Paolo Bonzini wrote:
> On 23/08/2017 21:26, Eric Blake wrote:
>>> I agree with using the short form where possible, but I disagree on
>>> removing the long forms. Rather, global_qtest in my opinion should have
>>> been static (though I'm not proposing that you do this); inlining the
>>> wrappers is not needed for performance.
>> But no one outside of libqtest.c is using the long form. Maintaining a
>> long form that isn't used is counter-productive, if the short form is
>> good enough for everything we need.
>
> Well, whatever is assigning to global_qtest should be using the long form.
Question - what about going the other way, and switching ALL callers to
always use the explicit form? I'd really like to maintain only one
form, but if we think maintaining the explicit form is better, then I'd
rather see:
s = qtest_init(...);
qmp(s, "{'execute':'foo'}");
than:
qtest_init(...); // implicitly sets global_test
qmp("{'execute':'foo'}"); // implicitly uses global_test
and not the existing:
qtest_init(...);
qtest_qmp(global_test, "{'execute':'foo'}");
Then, in combination with my other series to make qmp() more friendly,
it would look like:
s = qtest_init(...);
qmp(s, "foo");
Or, put another way, I'd rather have the short name irq_intercept_in()
than the long name qtest_irq_intercept_in(); but as long as we maintain
only ONE set of names, then I'm okay having that one set always be
explicit about passing QTestState *s as a parameter and completely
getting rid of the global_test variable (rather than making it static).
But whatever we decide, we'll want to stick to it, and it may require a
respin - so let's get a consensus before I do any more churn on this series.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v5 10/13] libqtest: Drop qtest_init() and qtest_qmp_discard_response(), (continued)
- [Qemu-devel] [PATCH v5 10/13] libqtest: Drop qtest_init() and qtest_qmp_discard_response(), Eric Blake, 2017/08/18
- [Qemu-devel] [PATCH v5 09/13] libqtest: Shorten a couple more qtest_* functions, Eric Blake, 2017/08/18
- [Qemu-devel] [PATCH v5 12/13] libqtest: Use global_qtest in qtest_sendf() and qtest_rsp(), Eric Blake, 2017/08/18
- [Qemu-devel] [PATCH v5 13/13] numa-test: Use hmp(), Eric Blake, 2017/08/18
- [Qemu-devel] [PATCH v5 08/13] tests: Rely more on global_qtest, Eric Blake, 2017/08/18
- Re: [Qemu-devel] [PATCH v5 08/13] tests: Rely more on global_qtest, John Snow, 2017/08/18
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on global_qtest, Paolo Bonzini, 2017/08/19
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on global_qtest, Eric Blake, 2017/08/23
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on global_qtest, Paolo Bonzini, 2017/08/23
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on global_qtest,
Eric Blake <=
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on global_qtest, Paolo Bonzini, 2017/08/23
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on global_qtest, Markus Armbruster, 2017/08/24
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on global_qtest, Paolo Bonzini, 2017/08/24
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on global_qtest, Markus Armbruster, 2017/08/24
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on global_qtest, Paolo Bonzini, 2017/08/24
- Re: [Qemu-devel] [Qemu-block] [PATCH v5 08/13] tests: Rely more on global_qtest, Markus Armbruster, 2017/08/24
[Qemu-devel] [PATCH v5 11/13] libqtest: Drop many static inline qtest_ wrappers, Eric Blake, 2017/08/18