fix: tolerate QMP socket removal during status probes
This commit is contained in:
+4
-2
@@ -182,9 +182,11 @@ class Runtime:
|
||||
raise RuntimeError(f'Cannot verify VM identity: {exc}') from exc
|
||||
|
||||
def _listening(self, path: Path) -> bool:
|
||||
if not path.exists():
|
||||
try:
|
||||
mode = path.lstat().st_mode
|
||||
except FileNotFoundError:
|
||||
return False
|
||||
if not stat.S_ISSOCK(path.lstat().st_mode):
|
||||
if not stat.S_ISSOCK(mode):
|
||||
raise RuntimeError(f'Refusing non-socket runtime path: {path}')
|
||||
with socket.socket(socket.AF_UNIX) as probe:
|
||||
probe.settimeout(min(1, self.boot_timeout))
|
||||
|
||||
Reference in New Issue
Block a user