We can use qemuDomainSetupMemory() to obtain the path that we
need to unlink() from within domain's namespace.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain_namespace.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_domain_namespace.c b/src/qemu/qemu_domain_namespace.c
index 8251554e73..aaf45859d3 100644
--- a/src/qemu/qemu_domain_namespace.c
+++ b/src/qemu/qemu_domain_namespace.c
@@ -1492,13 +1492,15 @@ int
qemuDomainNamespaceTeardownMemory(virDomainObjPtr vm,
virDomainMemoryDefPtr mem)
{
+ VIR_AUTOSTRINGLIST paths = NULL;
+
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
- if (mem->model != VIR_DOMAIN_MEMORY_MODEL_NVDIMM)
- return 0;
+ if (qemuDomainSetupMemory(mem, &paths) < 0)
+ return -1;
- if (qemuDomainNamespaceUnlinkPath(vm, mem->nvdimmPath) < 0)
+ if (qemuDomainNamespaceUnlinkPaths(vm, (const char **) paths) < 0)
return -1;
return 0;
--
2.26.2