]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Add API to change qemu agent response timeout
authorJonathon Jongsma <jjongsma@redhat.com>
Wed, 13 Nov 2019 22:06:09 +0000 (16:06 -0600)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 14 Nov 2019 18:10:01 +0000 (19:10 +0100)
commit95f5ac9ae52455e9da47afc95fa31c9456ac27ae
tree82706c1aed6fe3158d2e3591dfd656bbf3818053
parent954f36e078d44ece7ee79a9cb099d8195a347275
Add API to change qemu agent response timeout

Some layered products such as oVirt have requested a way to avoid being
blocked by guest agent commands when querying a loaded vm. For example,
many guest agent commands are polled periodically to monitor changes,
and rather than blocking the calling process, they'd prefer to simply
time out when an agent query is taking too long.

This patch adds a way for the user to specify a custom agent timeout
that is applied to all agent commands.

One special case to note here is the 'guest-sync' command. 'guest-sync'
is issued internally prior to calling any other command. (For example,
when libvirt wants to call 'guest-get-fsinfo', we first call
'guest-sync' and then call 'guest-get-fsinfo').

Previously, the 'guest-sync' command used a 5-second timeout
(VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT), whereas the actual command that
followed always blocked indefinitely
(VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK). As part of this patch, if a
custom timeout is specified that is shorter than
5 seconds,  this new timeout is also used for 'guest-sync'. If there is
no custom timeout or if the custom timeout is longer than 5 seconds, we
will continue to use the 5-second timeout.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
24 files changed:
include/libvirt/libvirt-domain.h
include/libvirt/libvirt-qemu.h
src/driver-hypervisor.h
src/libvirt-domain.c
src/libvirt_public.syms
src/qemu/qemu_agent.c
src/qemu/qemu_agent.h
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_driver.c
src/remote/remote_driver.c
src/remote/remote_protocol.x
src/remote_protocol-structs
tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
tests/qemustatusxml2xmldata/blockjob-mirror-in.xml
tests/qemustatusxml2xmldata/disk-secinfo-upgrade-out.xml
tests/qemustatusxml2xmldata/migration-in-params-in.xml
tests/qemustatusxml2xmldata/migration-out-nbd-out.xml
tests/qemustatusxml2xmldata/migration-out-nbd-tls-out.xml
tests/qemustatusxml2xmldata/migration-out-params-in.xml
tests/qemustatusxml2xmldata/modern-in.xml
tests/qemustatusxml2xmldata/vcpus-multi-in.xml
tools/virsh-domain.c
tools/virsh.pod