From b92ea5a61ef7e19cd64bf570a21e5ea33c1ca5c9 Mon Sep 17 00:00:00 2001
From: Recolic <git@me.recolic.net>
Date: Tue, 16 Jan 2024 16:31:15 -0800
Subject: [PATCH] .use real config as sample

---
 cron-callback.sh | 4 ++--
 runtime.settings | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/cron-callback.sh b/cron-callback.sh
index 87387ea..143f32f 100755
--- a/cron-callback.sh
+++ b/cron-callback.sh
@@ -88,13 +88,13 @@ function start_vm_if_not_running () {
     local uuid=`uuidgen --namespace @oid --name "qemu.$name" --sha1`
 
     # Check if qemu already running for this instance.
-    ps aux | grep -F "uuid $uuid" | grep qemu && return 0
+    ps aux | grep -F "uuid $uuid" | grep qemu > /dev/null 2>&1 && return 0
 
     # start it
     [[ ! -f "vm/$name/disk.img" ]] && echo2 "In start_vm, disk image vm/$name/disk.img doesn't exist. Did init_vm fail?" && return 1
     echo2 "+ Starting VM $name with options_txt '$options_txt' and uuid $uuid..."
     [[ -f "vm/$name/initimg.iso" ]] && options+=(-cdrom "vm/$name/initimg.iso")
-    nohup qemu-system-x86_64 --uuid "$uuid" -drive file="vm/$name/disk.img",if=virtio -cpu host --enable-kvm -bios /usr/share/edk2-ovmf/x64/OVMF.fd -net nic,model=rtl8139 "${options[@]}" >> tmp/qemu.log 2>&1 & disown
+    nohup qemu-system-x86_64 --uuid "$uuid" -drive file="vm/$name/disk.img",if=virtio -cpu host --enable-kvm -net nic,model=rtl8139 "${options[@]}" >> tmp/qemu.log 2>&1 & disown
 }
 
 function do_init () {
diff --git a/runtime.settings b/runtime.settings
index 85b6ee8..c486c76 100644
--- a/runtime.settings
+++ b/runtime.settings
@@ -1,5 +1,5 @@
 # name;options (name will be trimmed, options will be passed as-is)
 ubuntucorp  ;-m 2G -smp 2 -vnc :10 -net user,hostfwd=tcp::30471-:22
-ndpa-build  ;-m 8G -smp 4 -vnc :11 -net user,hostfwd=tcp::30472-:22
-gitlab-ci-ms;-m 4G -smp 3 -vnc :12 -net user,hostfwd=tcp::30473-:22
-devbox      ;-m 8G -smp 8 -vnc :13 -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time -nic tap,ifname=vnic0,script=no,downscript=no,mac=10:11:11:11:11:10 -chardev socket,id=chrtpm,path=/tmp/mytpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
+ndpa-build  ;-m 8G -smp 4 -vnc :11 -net user,hostfwd=tcp::30472-:22 -bios /usr/share/edk2-ovmf/x64/OVMF.fd
+gitlab-ci-ms;-m 4G -smp 3 -vnc :12 -net user,hostfwd=tcp::30473-:22 -bios /usr/share/edk2-ovmf/x64/OVMF.fd
+devbox      ;-m 8G -smp 8 -vnc :13                                  -bios /usr/share/edk2-ovmf/x64/OVMF.fd -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time -nic tap,ifname=vnic0,script=no,downscript=no,mac=10:11:11:11:11:10 -chardev socket,id=chrtpm,path=/tmp/mytpm.sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
-- 
GitLab