forked from uncloud/uncloud
VMM: make use of socket_dir
This commit is contained in:
parent
4c6a126d8b
commit
a759b8aa39
1 changed files with 5 additions and 5 deletions
|
@ -125,7 +125,7 @@ class VMM:
|
||||||
os.makedirs(self.socket_dir, exist_ok=True)
|
os.makedirs(self.socket_dir, exist_ok=True)
|
||||||
|
|
||||||
def is_running(self, uuid):
|
def is_running(self, uuid):
|
||||||
sock_path = os.path.join(self.vmm_backend, uuid)
|
sock_path = os.path.join(self.socket_dir, uuid)
|
||||||
try:
|
try:
|
||||||
sock = socket.socket(socket.AF_UNIX)
|
sock = socket.socket(socket.AF_UNIX)
|
||||||
sock.connect(sock_path)
|
sock.connect(sock_path)
|
||||||
|
@ -163,7 +163,7 @@ class VMM:
|
||||||
qmp_arg = (
|
qmp_arg = (
|
||||||
"-qmp",
|
"-qmp",
|
||||||
"unix:{},server,nowait".format(
|
"unix:{},server,nowait".format(
|
||||||
join_path(self.vmm_backend, uuid)
|
join_path(self.socket_dir, uuid)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
vnc_arg = (
|
vnc_arg = (
|
||||||
|
@ -212,7 +212,7 @@ class VMM:
|
||||||
def execute_command(self, uuid, command, **kwargs):
|
def execute_command(self, uuid, command, **kwargs):
|
||||||
# execute_command -> sucess?, output
|
# execute_command -> sucess?, output
|
||||||
try:
|
try:
|
||||||
with VMQMPHandles(os.path.join(self.vmm_backend, uuid)) as (
|
with VMQMPHandles(os.path.join(self.socket_dir, uuid)) as (
|
||||||
sock_handle,
|
sock_handle,
|
||||||
file_handle,
|
file_handle,
|
||||||
):
|
):
|
||||||
|
@ -255,8 +255,8 @@ class VMM:
|
||||||
def discover(self):
|
def discover(self):
|
||||||
vms = [
|
vms = [
|
||||||
uuid
|
uuid
|
||||||
for uuid in os.listdir(self.vmm_backend)
|
for uuid in os.listdir(self.socket_dir)
|
||||||
if not isdir(join_path(self.vmm_backend, uuid))
|
if not isdir(join_path(self.socket_dir, uuid))
|
||||||
]
|
]
|
||||||
return vms
|
return vms
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue