Compare commits

..

No commits in common. "2e56fb8ab0725711f1d0961c4507458e729280d5" and "7bd8c07fd41c9897ac2d5b668f5bcfc0cb53fe28" have entirely different histories.

2 changed files with 11 additions and 5 deletions

View file

@ -65,9 +65,6 @@ error_usage() {
public_start() { public_start() {
QEMUSH_NAME="$1" QEMUSH_NAME="$1"
set -- "$@" \
-monitor "unix:$(sockpath),server,nowait" \
-daemonize
if ! "$@"; then if ! "$@"; then
perror "error launching virtual machine \"${QEMUSH_NAME}\"" perror "error launching virtual machine \"${QEMUSH_NAME}\""
return 2 return 2
@ -80,7 +77,7 @@ public_watch() {
QEMUSH_NAME="$1" QEMUSH_NAME="$1"
shift shift
exec socat -,echo=0,icanon=0 "UNIX-CONNECT:$(sockpath)" socat -,echo=0,icanon=0 "UNIX-CONNECT:$(sockpath)"
} }
# List running virtual machines # List running virtual machines

View file

@ -1,5 +1,13 @@
#!/usr/bin/env python3 #!/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 # Set number of vCPUs to use to the environment variable QEMUSH_NPROC or
# half of total vCPUs installed if it fails # half of total vCPUs installed if it fails
try: try:
@ -22,7 +30,8 @@ except KeyError:
from sys import argv from sys import argv
command = [ command = [
'qemu-system-x86_64', 'qemu-system-x86_64',
'-enable-kvm', '-enable-kvm', '-daemonize',
'-monitor', socket,
'-M', 'q35', '-M', 'q35',
'-cpu', 'host', '-smp', nproc, '-cpu', 'host', '-smp', nproc,
'-m', ram, '-m', ram,