]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: agent: sync once if qemu has serial port event
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Thu, 5 Mar 2020 14:47:01 +0000 (17:47 +0300)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 12 Mar 2020 17:07:50 +0000 (18:07 +0100)
commitb47e3b9b5c556b7bc3c7d0d1a6452e0df8630653
tree0a0ee52928e60ed2634f6caca9bcd5277c91afcf
parenta30078cb832646177defd256e77c632905f1e6d0
qemu: agent: sync once if qemu has serial port event

Sync was introduced in [1] to check for ga presence. This
check is racy but in the era before serial events are available
there was not better solution I guess.

In case we have the events the sync function is different. It allows us
to flush stateless ga channel from remnants of previous communications.
But we need to do it only once. Until we get timeout on issued command
channel state is ok.

[1] qemu_agent: Issue guest-sync prior to every command

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_agent.c
src/qemu/qemu_agent.h
src/qemu/qemu_process.c
tests/qemumonitortestutils.c