mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-05 12:35:20 +00:00
virCommandGetArgList: Remove 'nargs' argument
The returned argument list is a NULL-terminated string list and the only caller doesn't use the count. Remove the argument. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
debc33ef84
commit
4b67fe3843
@ -2164,8 +2164,7 @@ virCommandToString(virCommand *cmd,
|
|||||||
|
|
||||||
int
|
int
|
||||||
virCommandGetArgList(virCommand *cmd,
|
virCommandGetArgList(virCommand *cmd,
|
||||||
char ***args,
|
char ***args)
|
||||||
size_t *nargs)
|
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
@ -2175,7 +2174,6 @@ virCommandGetArgList(virCommand *cmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
*args = g_new0(char *, cmd->nargs);
|
*args = g_new0(char *, cmd->nargs);
|
||||||
*nargs = cmd->nargs - 1;
|
|
||||||
|
|
||||||
for (i = 1; i < cmd->nargs; i++)
|
for (i = 1; i < cmd->nargs; i++)
|
||||||
(*args)[i - 1] = g_strdup(cmd->args[i]);
|
(*args)[i - 1] = g_strdup(cmd->args[i]);
|
||||||
|
@ -178,7 +178,7 @@ int virCommandToStringBuf(virCommand *cmd,
|
|||||||
bool linebreaks,
|
bool linebreaks,
|
||||||
bool stripCommandPath);
|
bool stripCommandPath);
|
||||||
|
|
||||||
int virCommandGetArgList(virCommand *cmd, char ***args, size_t *nargs);
|
int virCommandGetArgList(virCommand *cmd, char ***args);
|
||||||
|
|
||||||
int virCommandExec(virCommand *cmd, gid_t *groups, int ngroups) G_GNUC_WARN_UNUSED_RESULT;
|
int virCommandExec(virCommand *cmd, gid_t *groups, int ngroups) G_GNUC_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
|
@ -558,7 +558,6 @@ testCompareXMLToArgvValidateSchema(virQEMUDriver *drv,
|
|||||||
g_auto(GStrv) args = NULL;
|
g_auto(GStrv) args = NULL;
|
||||||
g_autoptr(virDomainObj) vm = NULL;
|
g_autoptr(virDomainObj) vm = NULL;
|
||||||
qemuDomainObjPrivate *priv = NULL;
|
qemuDomainObjPrivate *priv = NULL;
|
||||||
size_t nargs = 0;
|
|
||||||
GHashTable *schema = NULL;
|
GHashTable *schema = NULL;
|
||||||
g_autoptr(virCommand) cmd = NULL;
|
g_autoptr(virCommand) cmd = NULL;
|
||||||
unsigned int parseFlags = info->parseFlags;
|
unsigned int parseFlags = info->parseFlags;
|
||||||
@ -600,7 +599,7 @@ testCompareXMLToArgvValidateSchema(virQEMUDriver *drv,
|
|||||||
if (!(cmd = testCompareXMLToArgvCreateArgs(drv, vm, migrateURI, info, flags)))
|
if (!(cmd = testCompareXMLToArgvCreateArgs(drv, vm, migrateURI, info, flags)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virCommandGetArgList(cmd, &args, &nargs) < 0)
|
if (virCommandGetArgList(cmd, &args) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (testCompareXMLToArgvValidateSchemaCommand(args, schema) < 0)
|
if (testCompareXMLToArgvValidateSchemaCommand(args, schema) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user