Monitor: forget the App tab of a destroyed guest

This commit is contained in:
MacRimi
2026-10-26 18:02:30 +01:00
parent fc7c3181bc
commit b6500c147e
6 changed files with 171 additions and 0 deletions
+12
View File
@@ -2423,6 +2423,18 @@ class TaskWatcher:
# Get VM/CT name
vmname = self._get_vm_name(vmid) if vmid else ''
# A destroyed guest frees its VMID. It has no notification of its
# own, but the cache listener must forget what belonged to it.
if task_type in ('vzdestroy', 'qmdestroy'):
if status == 'OK' and self._guest_lifecycle_callback:
guest_type = 'lxc' if task_type == 'vzdestroy' else 'qemu'
try:
self._guest_lifecycle_callback(vmid, guest_type, 'destroy')
except Exception as exc:
print(f'[TaskWatcher] guest lifecycle callback failed for '
f'{guest_type} {vmid}: {exc}', flush=True)
return
# Map to event type
event_info = self.TASK_MAP.get(task_type)
if not event_info: