From 065f3f4c3415e56ff73f913dd0bf2cc24258f9e0 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 2 Nov 2016 19:19:34 +0100 Subject: QEMU Guest Agent bug mititigation for libvirt 1.2.9. --- tdfvm-install | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'tdfvm-install') 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 ( -- cgit v1.2.3