qemush : ajout possibilité de lancer une VM en avant-plan

This commit is contained in:
Ahurac 2024-03-25 23:29:12 +01:00
parent c114fe0b08
commit c24dbcdabb

View file

@ -53,12 +53,20 @@ error_usage() {
# Function to start a virtual machine
public_start() {
if [ "$1" = -f ] || [ "$1" = --foreground ]; then
daemonize=
else
daemonize=-daemonize
fi
while echo "$1" | grep -q '^-'; do shift; done;
export QEMUSH_NAME="$1"
set -- "$@" \
-name "$QEMUSH_NAME" \
-monitor "unix:$(pathof socket),server,nowait" \
-daemonize
$daemonize
if ! "$@"; then
perror "error launching virtual machine \"${QEMUSH_NAME}\""