xemu/python/qemu/qmp
John Snow d911accf0a python/qmp: clear events on get_events() call
All callers in the tree *already* clear the events after a call to
get_events(). Do it automatically instead and update callsites to remove
the manual clear call.

These semantics are quite a bit easier to emulate with async QMP, and
nobody appears to be abusing some emergent properties of what happens if
you decide not to clear them, so let's dial down to the dumber, simpler
thing.

Specifically: callers of clear() right after a call to get_events() are
more likely expressing their desire to not see any events they just
retrieved, whereas callers of clear_events() not in relation to a recent
call to pull_event/get_events are likely expressing their desire to
simply drop *all* pending events straight onto the floor. In the sync
world, this is safe enough; in the async world it's nearly impossible to
promise that nothing happens between getting and clearing the
events.

Making the retrieval also clear the queue is vastly simpler.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20210923004938.3999963-9-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
2021-10-12 12:22:11 -04:00
..
__init__.py python/qmp: clear events on get_events() call 2021-10-12 12:22:11 -04:00
py.typed python: expose typing information via PEP 561 2021-06-30 21:54:04 -04:00
qemu_ga_client.py python/qemu-ga-client: add entry point 2021-06-18 16:10:06 -04:00
qmp_shell.py python/qmp: clear events on get_events() call 2021-10-12 12:22:11 -04:00
qom_common.py python: Fix broken ReST docstrings 2021-06-30 21:57:08 -04:00
qom_fuse.py scripts/qom-fuse: move to python/qemu/qmp/qom_fuse.py 2021-06-18 16:10:06 -04:00
qom.py python/qom: Do not use 'err' name at module scope 2021-06-30 21:54:04 -04:00
README.rst python: add directory structure README.rst files 2021-06-01 16:21:21 -04:00

qemu.qmp package
================

This package provides a library used for connecting to and communicating
with QMP servers. It is used extensively by iotests, vm tests,
acceptance tests, and other utilities in the ./scripts directory. It is
not a fully-fledged SDK and is subject to change at any time.

See the documentation in ``__init__.py`` for more information.