From 8587327c9e67e801dc1545fc4f56c2c6f3dff5d7 Mon Sep 17 00:00:00 2001 From: Ahurac Date: Tue, 23 Jan 2024 10:30:54 +0100 Subject: [PATCH] =?UTF-8?q?qemush=20:=20options=20`-monitor`et=20`-daemoni?= =?UTF-8?q?ze`=20hardcod=C3=A9e=20au=20lieu=20d'=C3=AAtre=20dans=20le=20sc?= =?UTF-8?q?ript=20`kvm`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/qemush | 3 +++ qemu/launchers/kvm | 11 +---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/bin/qemush b/bin/qemush index 4991c99..97b2b2e 100755 --- a/bin/qemush +++ b/bin/qemush @@ -65,6 +65,9 @@ error_usage() { public_start() { QEMUSH_NAME="$1" + set -- "$@" \ + -monitor "unix:$(sockpath),server,nowait" \ + -daemonize if ! "$@"; then perror "error launching virtual machine \"${QEMUSH_NAME}\"" return 2 diff --git a/qemu/launchers/kvm b/qemu/launchers/kvm index 82ef336..772ce41 100755 --- a/qemu/launchers/kvm +++ b/qemu/launchers/kvm @@ -1,13 +1,5 @@ #!/usr/bin/env python3 -# Retrieve the name of the monitor socket -from subprocess import CalledProcessError -try: - from subprocess import check_output - socket = 'unix:%s,server,nowait' % (check_output(["sockpath"], text=True)) -except CalledProcessError as e: - exit(e.returncode) - # Set number of vCPUs to use to the environment variable QEMUSH_NPROC or # half of total vCPUs installed if it fails try: @@ -30,8 +22,7 @@ except KeyError: from sys import argv command = [ 'qemu-system-x86_64', - '-enable-kvm', '-daemonize', - '-monitor', socket, + '-enable-kvm', '-M', 'q35', '-cpu', 'host', '-smp', nproc, '-m', ram,