Change qemu-pid detection.
This commit is contained in:
parent
63387b8f50
commit
7f917c29c9
1 changed files with 4 additions and 10 deletions
14
qemu-vm
14
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)") \
|
||||
|
|
Loading…
Add table
Reference in a new issue