So far, the only caller qemuDomainNamespaceUnlinkPath() will
always pass a single path to unlink, but similarly to
qemuDomainNamespaceMknodPaths() - there are a few callers that
would like to pass two or more files to unlink at once (held in a
string list). Make the @paths argument a string list then.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain_namespace.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_domain_namespace.c b/src/qemu/qemu_domain_namespace.c
index 4e0b50d885..135842e212 100644
--- a/src/qemu/qemu_domain_namespace.c
+++ b/src/qemu/qemu_domain_namespace.c
@@ -1307,8 +1307,7 @@ qemuDomainDetachDeviceUnlinkHelper(pid_t pid G_GNUC_UNUSED,
static int
qemuDomainNamespaceUnlinkPaths(virDomainObjPtr vm,
- const char **paths,
- size_t npaths)
+ const char **paths)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virQEMUDriverPtr driver = priv->driver;
@@ -1316,9 +1315,11 @@ qemuDomainNamespaceUnlinkPaths(virDomainObjPtr vm,
VIR_AUTOSTRINGLIST unlinkPaths = NULL;
char **devMountsPath = NULL;
size_t ndevMountsPath = 0;
+ size_t npaths;
size_t i;
int ret = -1;
+ npaths = virStringListLength(paths);
if (!npaths)
return 0;
@@ -1363,9 +1364,9 @@ static int
qemuDomainNamespaceUnlinkPath(virDomainObjPtr vm,
const char *path)
{
- const char *paths[] = { path };
+ const char *paths[] = { path, NULL };
- return qemuDomainNamespaceUnlinkPaths(vm, paths, 1);
+ return qemuDomainNamespaceUnlinkPaths(vm, paths);
}
--
2.26.2