On Fri, Jan 29, 2021 at 02:31:08PM +0800, Zhang Dewan wrote:
On Fri, Jan 29, 2021 at 11:27:25AM +0800, Xiao Shenwei wrote:
[why] when we need reboot a vm, we need get it's pid from hostname, then check job_id is the same as required.
[how] -name guest=$hostname,process=$job_id
if you need reboot the vm: pkill $job_id
good! maybe cound use: pkill -f $job_id
# pkill --help | grep full -f, --full use full process name to match
Signed-off-by: Xiao Shenwei xiaoshenwei96@163.com
providers/qemu/kvm.sh | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/providers/qemu/kvm.sh b/providers/qemu/kvm.sh index 66099ee..dd657cb 100755 --- a/providers/qemu/kvm.sh +++ b/providers/qemu/kvm.sh @@ -39,6 +39,9 @@ parse_ipxe_script() ;; initrd) file=$(basename "$b")
[ $file == "job.cgz" ] && {
job_id=$(basename $(dirname "$b"))
} wget --timestamping -a ${log_file} --progress=bar:force $b initrds+="$file " ;;
@@ -144,6 +147,7 @@ public_option() { kvm=( $qemu
-name guest=$hostname,process=$job_id
^ what's the meaning of this?
# qemu-kvm --help | grep name | grep process -name string1[,process=string2][,debug-threads=on|off] string1 sets the window title and string2 the process name
-name string1[,process=string2][,debug-threads=on|off] set the name of the guest
Thanks, Shenwei
-kernel $kernel -initrd $initrd -smp $nr_cpu
-- 2.23.0