diff --git a/qemu-vm b/qemu-vm index 60c2fb4..8a7b1b3 100755 --- a/qemu-vm +++ b/qemu-vm @@ -90,17 +90,11 @@ $SUDO qemu-system-$(uname -m) \ -drive if=pflash,format=raw,readonly=on,file="$EFI_FIRMWARE" \ -drive if=pflash,format=raw,file="$EFI_VARS" \ "${qemu_arguments[@]}" & -qemu_pid="$!" set +x -while :; do - _l="$(ps --ppid "$qemu_pid" | tail -n+2 || true)" - if [ "$_l" = '' ]; then - echo waiting - sleep .1 - continue - fi - qemu_pid="$(awk '{print $1}' <<< "$_l")" - break +qemu_pid= +while [[ "$qemu_pid" = '' ]]; do + qemu_pid="$(pidof qemu-system-$(uname -m) || true)" + sleep .1 done $SUDO qemu-affinity \ -k $(qemu-vm-cpus decompress_seq "$(qemu-vm-cpus compute_vm $NUM_PROCESSORS)") \