]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_process: Destroy domain's namespace after killing QEMU
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 3 Aug 2022 10:27:19 +0000 (12:27 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 4 Aug 2022 13:33:11 +0000 (15:33 +0200)
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 <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_process.c

index d29da63242342c77e79c04753518338a6f121c95..fbf460595bf1f43ab93997e77a06ed1ec19684c9 100644 (file)
@@ -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);