aboutsummaryrefslogtreecommitdiffstats
path: root/tdfvm-install
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@libreoffice.org>2016-11-02 19:19:34 +0100
committerGuilhem Moulin <guilhem@libreoffice.org>2016-11-02 19:19:34 +0100
commit065f3f4c3415e56ff73f913dd0bf2cc24258f9e0 (patch)
tree06864cc0cf0e87208704b19c76090fb0e4ea8cf4 /tdfvm-install
parent4b6c9f2c86a8a8fbbfc946d1433db864371ca3b4 (diff)
QEMU Guest Agent bug mititigation for libvirt 1.2.9.
Diffstat (limited to 'tdfvm-install')
-rwxr-xr-xtdfvm-install18
1 files changed, 11 insertions, 7 deletions
diff --git a/tdfvm-install b/tdfvm-install
index e1091fb..10e83b3 100755
--- a/tdfvm-install
+++ b/tdfvm-install
@@ -304,20 +304,24 @@ xmlstarlet edit --omit-decl --inplace \
[ "$TRANSIENT" = y ] || virsh -c "$LIBVIRT_URI" define "$VMDIR/$VM_NAME.xml"
# wait until the guest starts its QEMU Agent at the end of the installation
-while :; do
- ./virsh-ga -c "$LIBVIRT_URI" "$VM_NAME" ping && break || rv=$?
- [ $rv -eq 128 ] || exit $rv
- sleep 1
-done
+guest_agent() {
+ local rv
+ while :; do
+ ./virsh-ga -c "$LIBVIRT_URI" "$VM_NAME" "$@" && break || rv=$?
+ [ $rv -eq 128 ] || exit $rv
+ sleep 1
+ done
+}
+guest_agent ping
# then copy the public key material
for path in /etc/ssh/ssh_host_rsa_key.pub \
/etc/ssh/ssh_host_ed25519_key.pub \
/etc/salt/pki/minion/minion.pub; do
- ./virsh-ga -c "$LIBVIRT_URI" "$VM_NAME" cat "$path" >"$VMDIR/${path##*/}"
+ guest_agent cat "$path" >"$VMDIR/${path##*/}"
done
-./virsh-ga -c "$LIBVIRT_URI" "$VM_NAME" touch /tmp/tdf-install-continue
+guest_agent touch /tmp/tdf-install-continue
virsh -c "$LIBVIRT_URI" console "$VM_NAME" --safe >/dev/null # wait until shutdown
(