We can use qemuDomainSetupInput() 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 | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/src/qemu/qemu_domain_namespace.c b/src/qemu/qemu_domain_namespace.c
index 89d73b26ef..51d3497670 100644
--- a/src/qemu/qemu_domain_namespace.c
+++ b/src/qemu/qemu_domain_namespace.c
@@ -1360,16 +1360,6 @@ qemuDomainNamespaceUnlinkPaths(virDomainObjPtr vm,
}
-static int
-qemuDomainNamespaceUnlinkPath(virDomainObjPtr vm,
- const char *path)
-{
- const char *paths[] = { path, NULL };
-
- return qemuDomainNamespaceUnlinkPaths(vm, paths);
-}
-
-
int
qemuDomainNamespaceSetupDisk(virDomainObjPtr vm,
virStorageSourcePtr src)
@@ -1605,15 +1595,15 @@ int
qemuDomainNamespaceTeardownInput(virDomainObjPtr vm,
virDomainInputDefPtr input)
{
- const char *path = NULL;
+ VIR_AUTOSTRINGLIST paths = NULL;
if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
return 0;
- if (!(path = virDomainInputDefGetPath(input)))
- return 0;
+ if (qemuDomainSetupInput(input, &paths) < 0)
+ return -1;
- if (path && qemuDomainNamespaceUnlinkPath(vm, path) < 0)
+ if (qemuDomainNamespaceUnlinkPaths(vm, (const char **) paths) < 0)
return -1;
return 0;
--
2.26.2