launchers/kvm : chargement maxi-paresseux
This commit is contained in:
parent
1268015dee
commit
849f6de9bd
1 changed files with 2 additions and 2 deletions
|
@ -1,17 +1,17 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# Retrieve the name of the monitor socket
|
# Retrieve the name of the monitor socket
|
||||||
from subprocess import check_output
|
|
||||||
from subprocess import CalledProcessError
|
from subprocess import CalledProcessError
|
||||||
try:
|
try:
|
||||||
|
from subprocess import check_output
|
||||||
socket = 'unix:%s,server,nowait' % (check_output(["sockpath"], text=True))
|
socket = 'unix:%s,server,nowait' % (check_output(["sockpath"], text=True))
|
||||||
except CalledProcessError as e:
|
except CalledProcessError as e:
|
||||||
exit(e.returncode)
|
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
|
||||||
from os import environ
|
|
||||||
try:
|
try:
|
||||||
|
from os import environ
|
||||||
nproc = environ['QEMUSH_NPROC']
|
nproc = environ['QEMUSH_NPROC']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
from multiprocessing import cpu_count
|
from multiprocessing import cpu_count
|
||||||
|
|
Loading…
Reference in a new issue