mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
qemuDomainNamespaceUnlinkPaths: Turn @paths into string list
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@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
52fa81ac52
commit
f7feac4ba8
@ -1306,8 +1306,7 @@ qemuNamespaceUnlinkHelper(pid_t pid G_GNUC_UNUSED,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
qemuNamespaceUnlinkPaths(virDomainObjPtr vm,
|
qemuNamespaceUnlinkPaths(virDomainObjPtr vm,
|
||||||
const char **paths,
|
const char **paths)
|
||||||
size_t npaths)
|
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
virQEMUDriverPtr driver = priv->driver;
|
virQEMUDriverPtr driver = priv->driver;
|
||||||
@ -1315,9 +1314,11 @@ qemuNamespaceUnlinkPaths(virDomainObjPtr vm,
|
|||||||
VIR_AUTOSTRINGLIST unlinkPaths = NULL;
|
VIR_AUTOSTRINGLIST unlinkPaths = NULL;
|
||||||
char **devMountsPath = NULL;
|
char **devMountsPath = NULL;
|
||||||
size_t ndevMountsPath = 0;
|
size_t ndevMountsPath = 0;
|
||||||
|
size_t npaths;
|
||||||
size_t i;
|
size_t i;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
|
npaths = virStringListLength(paths);
|
||||||
if (!npaths)
|
if (!npaths)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -1362,9 +1363,9 @@ static int
|
|||||||
qemuNamespaceUnlinkPath(virDomainObjPtr vm,
|
qemuNamespaceUnlinkPath(virDomainObjPtr vm,
|
||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
const char *paths[] = { path };
|
const char *paths[] = { path, NULL };
|
||||||
|
|
||||||
return qemuNamespaceUnlinkPaths(vm, paths, 1);
|
return qemuNamespaceUnlinkPaths(vm, paths);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user