anvil/tools/anvil-virsh-wrapper
Fabio M. Di Nitto 824e3e07e3 virsh: add wrapper to serialize calls to virsh list
avoid storm of virsh list that overloads libvirtd API causing
unnecessary timeouts during pcmk monitoring operations.

Resolves: https://github.com/ClusterLabs/anvil/issues/395

Signed-off-by: Fabio M. Di Nitto <fabbione@fabbione.net>
2023-08-07 08:35:08 +02:00

11 lines
116 B
Bash
Executable File

#!/bin/sh -e
(
if [ "$1" != "list" ]; then
virsh $@
exit $?
fi
flock -e 200
virsh $@
) 200>/tmp/virsh.lock