qemu/launchers : launchers qui correspondaient à des paramètres -> launchers avec la variable QEMUSH_BASE

This commit is contained in:
Ahurac 2024-01-25 16:14:57 +01:00
parent 9cc7cad967
commit 2119154718
3 changed files with 11 additions and 7 deletions

View file

@ -1,8 +1,8 @@
#!/bin/sh -x #!/bin/sh -x
exec kvm \ exec "$QEMUSH_BASE" \
-vga qxl \ -vga qxl \
-chardev spicevmc,id=vdagent,debug=0,name=vdagent \ -chardev spicevmc,id=vdagent,debug=0,name=vdagent \
-device virtio-serial \ -device virtio-serial \
-device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \ -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \
-spice port="$(first-free-port 5900)",addr=127.0.0.1,disable-ticketing=on \ -spice port="$(first-free-port 5900)",addr=127.0.0.1,disable-ticketing=on \
"$@" "$@"

7
qemu/launchers/virtiofs Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh -x
exec "${QEMUSH_BASE}" \
-chardev socket,id=char0,path=/run/virtiofsd.sock \
-device vhost-user-fs-pci,chardev=char0,tag=shared \
-object memory-backend-memfd,id=mem,size="${QEMUSH_RAM}",share=on \
-numa node,memdev=mem \
"$@"

View file

@ -3,16 +3,13 @@
# Store VM name in environment variable # Store VM name in environment variable
export QEMUSH_NAME export QEMUSH_NAME
export QEMUSH_RAM=4G export QEMUSH_RAM=4G
export QEMUSH_BASE=kvm
[ -z "$QEMUSH_NAME" ] && QEMUSH_NAME=$(basename "$0") [ -z "$QEMUSH_NAME" ] && QEMUSH_NAME=$(basename "$0")
# Launch the virtual machine # Launch the virtual machine
exec kvm-spice \ exec spice \
-drive file="$(pathof disk)",if=virtio \ -drive file="$(pathof disk)",if=virtio \
-net user,hostname="${QEMUSH_NAME}" \ -net user,hostname="${QEMUSH_NAME}" \
-usbdevice tablet \ -usbdevice tablet \
-name "$QEMUSH_NAME" \ -name "$QEMUSH_NAME" \
-chardev socket,id=char0,path=/run/virtiofsd.sock \
-device vhost-user-fs-pci,chardev=char0,tag=shared \
-object memory-backend-memfd,id=mem,size="${QEMUSH_RAM}",share=on \
-numa node,memdev=mem \
"$@" "$@"