diff options
Diffstat (limited to 'tdfvm-install')
-rwxr-xr-x | tdfvm-install | 18 |
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 ( |