diff --git a/qemu/launchers/kvm b/qemu/launchers/kvm index 141a008..82ef336 100755 --- a/qemu/launchers/kvm +++ b/qemu/launchers/kvm @@ -1,17 +1,17 @@ #!/usr/bin/env python3 # Retrieve the name of the monitor socket -from subprocess import check_output 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 -from os import environ try: + from os import environ nproc = environ['QEMUSH_NPROC'] except KeyError: from multiprocessing import cpu_count