clan-vm-manager: Fixing vm starting.

This commit is contained in:
Qubasa
2024-02-16 16:10:49 +07:00
parent 0b0867907e
commit 8a0edddca7
8 changed files with 59 additions and 79 deletions

View File

@@ -43,7 +43,9 @@ def wait_vm_up(state_dir: Path) -> None:
timeout: float = 300
while True:
if timeout <= 0:
raise TimeoutError(f"qga socket {socket_file} not found. Is the VM running?")
raise TimeoutError(
f"qga socket {socket_file} not found. Is the VM running?"
)
if socket_file.exists():
break
sleep(0.1)
@@ -56,7 +58,9 @@ def wait_vm_down(state_dir: Path) -> None:
timeout: float = 300
while socket_file.exists():
if timeout <= 0:
raise TimeoutError(f"qga socket {socket_file} still exists. Is the VM down?")
raise TimeoutError(
f"qga socket {socket_file} still exists. Is the VM down?"
)
sleep(0.1)
timeout -= 0.1