[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libvirt] [RFC PATCH 19/19] qapi: Implement -compat deprecated-outpu
From: |
Markus Armbruster |
Subject: |
Re: [libvirt] [RFC PATCH 19/19] qapi: Implement -compat deprecated-output=hide for events |
Date: |
Thu, 24 Oct 2019 21:56:30 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Daniel P. Berrangé <address@hidden> writes:
> On Thu, Oct 24, 2019 at 02:34:58PM +0200, Markus Armbruster wrote:
>> This policy suppresses deprecated events, and thus permits "testing
>> the future".
>
> One thing that occurs to me is that this is a fairly passive impact
> on libvirt. eg it may well be not at all obvious if libvirt is behaving
> in a broken way due to an event not being emitted, as the code in
> question simply won't be triggered.
Intented use of -compat deprecated-input=error,deprecated-output=hide is
"testing the future": make QEMU behave as if the deprecated features
were already gone. Can be useful when you want to test code that deals
with the anticipated future *now*.
It can also be used to ferret out unknown uses of deprecated interfaces:
run test suite with it, see what fails. But as you note, the
deprecated-output=hide part is somewhat problematic in that role.
> With the current QMP this situation is unavoidable since QEMU doesn't
> know which events the client (libvirt) is actually using. QEMU just
> unconditionally emits all events.
>
> I've often wondered if we should have the client explicitly tell
> QEMU which events it wants to receive as part of the QMP greeting
> handshake.
>
> ie, libvirt knows which events it can handle. QEMU knows which
> events it can emit, and reports this via capabilities which
> libvirt probes.
>
> So on connecting libvirt can tell QEMU exactly which evnets it
> wants to get back. QEMU is now able to explicitly tell libvirt
> it has asked for a deprecated event, and so the logic from the
> "deprecated-input" option can take effect.
QEMU already reports its events via introspection. What's missing is an
event subscription mechanism. Should be feasible.
Additional benefit: can reduce I/O.
> We'd not need "deprecated-output" at that point.
If deprecated-input=error makes subscribing to a deprecated event fail,
we don't need deprecated-output=hide for events.
But events are not the only output: there's also command returns.
Consider query-cpus-fast. Returns list of CpuInfoFast. CpuInfoFast
member @arch is deprecated. deprecated-output=hide should hide it,
except it's not implemented in this series.
This is also "a fairly passive impact on libvirt", I'm afraid.
We have some 40 events, and having libvirt subscribe to the ones it
actually uses is obviously practical.
I doubt the subscription idea scales up to return values.
- [RFC PATCH 03/19] tests/test-qmp-cmds: Simplify test data setup, (continued)
- [RFC PATCH 03/19] tests/test-qmp-cmds: Simplify test data setup, Markus Armbruster, 2019/10/24
- [RFC PATCH 04/19] tests/test-qmp-event: Simplify test data setup, Markus Armbruster, 2019/10/24
- [RFC PATCH 01/19] tests/test-qmp-cmds: Factor out qmp_dispatch() test helpers, Markus Armbruster, 2019/10/24
- [RFC PATCH 12/19] qapi: Replace qmp_dispatch()'s TODO comment by an explanation, Markus Armbruster, 2019/10/24
- [RFC PATCH 15/19] qapi: Mark deprecated QMP commands with feature 'deprecated', Markus Armbruster, 2019/10/24
- [RFC PATCH 18/19] qapi: Include a warning in the response to a deprecated command, Markus Armbruster, 2019/10/24
- [RFC PATCH 19/19] qapi: Implement -compat deprecated-output=hide for events, Markus Armbruster, 2019/10/24
- [RFC PATCH 17/19] qapi: Implement -compat deprecated-input=crash for commands, Markus Armbruster, 2019/10/24
- [RFC PATCH 13/19] qapi: New special feature flag "deprecated", Markus Armbruster, 2019/10/24
- [RFC PATCH 05/19] tests/test-qmp-event: Use qobject_is_equal(), Markus Armbruster, 2019/10/24
- [RFC PATCH 14/19] qemu-options: New -compat to set policy for "funny" interfaces, Markus Armbruster, 2019/10/24
- [RFC PATCH 09/19] qapi: Inline do_qmp_dispatch() into qmp_dispatch(), Markus Armbruster, 2019/10/24
- [RFC PATCH 11/19] qapi: Simplify how qmp_dispatch() gets the request ID, Markus Armbruster, 2019/10/24
- [RFC PATCH 16/19] qapi: Implement -compat deprecated-input=reject for commands, Markus Armbruster, 2019/10/24
- [RFC PATCH 06/19] tests/test-qmp-event: Check event is actually emitted, Markus Armbruster, 2019/10/24
- [RFC PATCH 10/19] qapi: Simplify how qmp_dispatch() deals with QCO_NO_SUCCESS_RESP, Markus Armbruster, 2019/10/24
- [RFC PATCH 08/19] qapi: Consistently put @features parameter right after @ifcond, Markus Armbruster, 2019/10/24