[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 31/38] libqtest: Merge qtest_clock_*() with c
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH v7 31/38] libqtest: Merge qtest_clock_*() with clock_*() |
Date: |
Thu, 14 Sep 2017 06:35:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 12.09.2017 15:35, Eric Blake wrote:
> On 09/12/2017 05:45 AM, Thomas Huth wrote:
>> On 11.09.2017 19:20, Eric Blake wrote:
>>> Maintaining two layers of libqtest APIs, one that takes an explicit
>>> QTestState object, and the other that uses the implicit global_qtest,
>>> is annoying. In the interest of getting rid of global implicit
>>> state and having less code to maintain, merge:
>>> qtest_clock_set()
>>> qtest_clock_step()
>>> qtest_clock_step_next()
>>> with their short counterparts. All callers that previously
>>> used the short form now make it explicit that they are relying on
>>> global_qtest, and later patches can then clean things up to remove
>>> the global variable.
>>>
>
>>> @@ -446,7 +446,7 @@ int64_t qtest_clock_step(QTestState *s, int64_t step);
>>> *
>>> * Returns: The current value of the QEMU_CLOCK_VIRTUAL in nanoseconds.
>>> */
>>> -int64_t qtest_clock_set(QTestState *s, int64_t val);
>>> +int64_t clock_set(QTestState *s, int64_t val);
>> Could we please keep the "qtest" prefix here and rather get rid of the
>> other ones? Even if it's more to type, I prefer to have a proper prefix
>> here so that it is clear at the first sight that the functions belong to
>> the qtest framework.
>
> I suppose we can, although it makes more lines that are likely to bump
> up against 80 columns, and thus slightly more churn to reformat things
> to keep checkpatch happy. I like the shorter name, because less typing
> is easier to remember. I'd prefer a second opinion on naming before
> doing anything about it though - Markus or Paolo, do you have any
> preference?
IMHO you should at least keep the qtest prefix in patch 33/38 to avoid
confusion with the system definitions that have the same names (see "man
2 outb" for example).
Thomas
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v7 28/38] libqtest: Add qtest_[v]startf(), (continued)
- [Qemu-devel] [PATCH v7 29/38] libqtest: Merge qtest_init() into qtest_start(), Eric Blake, 2017/09/11
- [Qemu-devel] [PATCH v7 32/38] libqtest: Merge qtest_irq*() with irq*(), Eric Blake, 2017/09/11
- [Qemu-devel] [PATCH v7 31/38] libqtest: Merge qtest_clock_*() with clock_*(), Eric Blake, 2017/09/11
- [Qemu-devel] [PATCH v7 33/38] libqtest: Merge qtest_{in, out}[bwl]() with {in, out}[bwl](), Eric Blake, 2017/09/11
- [Qemu-devel] [PATCH v7 36/38] libqtest: Merge qtest_memset() with qmemset(), Eric Blake, 2017/09/11
- [Qemu-devel] [PATCH v7 35/38] libqtest: Merge qtest_{mem, buf}{read, write}() with {mem, buf}{read, write}(), Eric Blake, 2017/09/11
- [Qemu-devel] [PATCH v7 38/38] libqtest: Merge qtest_hmp() with hmp(), Eric Blake, 2017/09/11
- [Qemu-devel] [PATCH v7 37/38] libqtest: Separate qmp_discard_response() from command, Eric Blake, 2017/09/11
- [Qemu-devel] [PATCH v7 34/38] libqtest: Merge qtest_{read, write}[bwlq]() with {read, write}[bwlq](), Eric Blake, 2017/09/11