032100
From f030ed332be8742918127fa3cc27aebb47b56c19 Mon Sep 17 00:00:00 2001
032100
Message-Id: <f030ed332be8742918127fa3cc27aebb47b56c19@dist-git>
032100
From: Michal Privoznik <mprivozn@redhat.com>
032100
Date: Wed, 3 Aug 2022 12:27:19 +0200
032100
Subject: [PATCH] qemu_process: Destroy domain's namespace after killing QEMU
032100
032100
After QEMU is killed in qemuProcessStop() its mount namespace
032100
doesn't exist anymore, because it was the only process running
032100
there. Thus we should clear our internal flag that the domain has
032100
namespace enabled so that seclabel restore code does not try to
032100
enter it. We do the same in qemuProcessHandleMonitorEOF() but
032100
when it is us, who decides to kill QEMU rather than QEMU quitting
032100
we haven't seen EOF by the time qemuProcessStop() is called.
032100
032100
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
032100
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
032100
(cherry picked from commit 589536e75d2af745c8f27134b466b23e4fbe3e95)
032100
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2121141
032100
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
032100
---
032100
 src/qemu/qemu_process.c | 3 +++
032100
 1 file changed, 3 insertions(+)
032100
032100
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
032100
index 1c28d4b102..4b52d664c7 100644
032100
--- a/src/qemu/qemu_process.c
032100
+++ b/src/qemu/qemu_process.c
032100
@@ -8276,6 +8276,9 @@ void qemuProcessStop(virQEMUDriver *driver,
032100
                                  VIR_QEMU_PROCESS_KILL_FORCE|
032100
                                  VIR_QEMU_PROCESS_KILL_NOCHECK));
032100
 
032100
+    /* Its namespace is also gone then. */
032100
+    qemuDomainDestroyNamespace(driver, vm);
032100
+
032100
     qemuDomainCleanupRun(driver, vm);
032100
 
032100
     qemuExtDevicesStop(driver, vm);
032100
-- 
032100
2.37.2
032100