From: Michal Privoznik Date: Wed, 3 Aug 2022 10:27:19 +0000 (+0200) Subject: qemu_process: Destroy domain's namespace after killing QEMU X-Git-Tag: v8.7.0-rc1~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=589536e75d2af745c8f27134b466b23e4fbe3e95;p=thirdparty%2Flibvirt.git qemu_process: Destroy domain's namespace after killing QEMU After QEMU is killed in qemuProcessStop() its mount namespace doesn't exist anymore, because it was the only process running there. Thus we should clear our internal flag that the domain has namespace enabled so that seclabel restore code does not try to enter it. We do the same in qemuProcessHandleMonitorEOF() but when it is us, who decides to kill QEMU rather than QEMU quitting we haven't seen EOF by the time qemuProcessStop() is called. Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d29da63242..fbf460595b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8265,6 +8265,9 @@ void qemuProcessStop(virQEMUDriver *driver, VIR_QEMU_PROCESS_KILL_FORCE| VIR_QEMU_PROCESS_KILL_NOCHECK)); + /* Its namespace is also gone then. */ + qemuDomainDestroyNamespace(driver, vm); + qemuDomainCleanupRun(driver, vm); qemuExtDevicesStop(driver, vm);