1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

tools: remove unread variables

Some of libvirt APIs return the number of elements, but we
don't need them, only whether the API failed or not.

Delete the redundant variables.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Ján Tomko 2020-08-02 23:33:07 +02:00
parent ce2483f619
commit 9c4730c54b
2 changed files with 6 additions and 10 deletions

View File

@ -6886,7 +6886,6 @@ virshVcpuinfoInactive(vshControl *ctl,
{
g_autofree unsigned char *cpumaps = NULL;
size_t cpumaplen;
int ncpus;
g_autoptr(virBitmap) vcpus = NULL;
ssize_t nextvcpu = -1;
bool first = true;
@ -6897,9 +6896,9 @@ virshVcpuinfoInactive(vshControl *ctl,
cpumaplen = VIR_CPU_MAPLEN(maxcpu);
cpumaps = vshMalloc(ctl, virBitmapSize(vcpus) * cpumaplen);
if ((ncpus = virDomainGetVcpuPinInfo(dom, virBitmapSize(vcpus),
if (virDomainGetVcpuPinInfo(dom, virBitmapSize(vcpus),
cpumaps, cpumaplen,
VIR_DOMAIN_AFFECT_CONFIG)) < 0)
VIR_DOMAIN_AFFECT_CONFIG) < 0)
return false;
while ((nextvcpu = virBitmapNextSetBit(vcpus, nextvcpu)) >= 0) {

View File

@ -1037,7 +1037,6 @@ static const vshCmdOptDef opts_daemon_log_filters[] = {
static bool
cmdDaemonLogFilters(vshControl *ctl, const vshCmd *cmd)
{
int nfilters;
char *filters = NULL;
vshAdmControlPtr priv = ctl->privData;
@ -1049,8 +1048,8 @@ cmdDaemonLogFilters(vshControl *ctl, const vshCmd *cmd)
return false;
}
} else {
if ((nfilters = virAdmConnectGetLoggingFilters(priv->conn,
&filters, 0)) < 0) {
if (virAdmConnectGetLoggingFilters(priv->conn,
&filters, 0) < 0) {
vshError(ctl, _("Unable to get daemon logging filters information"));
return false;
}
@ -1091,7 +1090,6 @@ static const vshCmdOptDef opts_daemon_log_outputs[] = {
static bool
cmdDaemonLogOutputs(vshControl *ctl, const vshCmd *cmd)
{
int noutputs;
char *outputs = NULL;
vshAdmControlPtr priv = ctl->privData;
@ -1103,8 +1101,7 @@ cmdDaemonLogOutputs(vshControl *ctl, const vshCmd *cmd)
return false;
}
} else {
if ((noutputs = virAdmConnectGetLoggingOutputs(priv->conn,
&outputs, 0)) < 0) {
if (virAdmConnectGetLoggingOutputs(priv->conn, &outputs, 0) < 0) {
vshError(ctl, _("Unable to get daemon logging outputs information"));
return false;
}