|
|
fbe740 |
From d5bc155a97d1938e0e19f6040ae76cdd0a92ed62 Mon Sep 17 00:00:00 2001
|
|
|
fbe740 |
Message-Id: <d5bc155a97d1938e0e19f6040ae76cdd0a92ed62@dist-git>
|
|
|
fbe740 |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
fbe740 |
Date: Mon, 16 Mar 2020 22:11:34 +0100
|
|
|
fbe740 |
Subject: [PATCH] qemuAgentFSInfoFormatParams: Remove pointless returned value
|
|
|
fbe740 |
MIME-Version: 1.0
|
|
|
fbe740 |
Content-Type: text/plain; charset=UTF-8
|
|
|
fbe740 |
Content-Transfer-Encoding: 8bit
|
|
|
fbe740 |
|
|
|
fbe740 |
The only caller doesn't check the value and also there are no real
|
|
|
fbe740 |
errors to report anyways.
|
|
|
fbe740 |
|
|
|
fbe740 |
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
fbe740 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
fbe740 |
(cherry picked from commit da1b1932271ee135537b2809e87dc621748d4630)
|
|
|
fbe740 |
|
|
|
fbe740 |
https://bugzilla.redhat.com/show_bug.cgi?id=1812965
|
|
|
fbe740 |
Message-Id: <04feacc921ce5c6f0333a4c4af7ccef8b22db6a1.1584391726.git.pkrempa@redhat.com>
|
|
|
fbe740 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
fbe740 |
---
|
|
|
fbe740 |
src/qemu/qemu_driver.c | 31 ++++++++++++-------------------
|
|
|
fbe740 |
1 file changed, 12 insertions(+), 19 deletions(-)
|
|
|
fbe740 |
|
|
|
fbe740 |
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
|
fbe740 |
index 26f100177b..8c7e90531a 100644
|
|
|
fbe740 |
--- a/src/qemu/qemu_driver.c
|
|
|
fbe740 |
+++ b/src/qemu/qemu_driver.c
|
|
|
fbe740 |
@@ -22996,24 +22996,20 @@ qemuDomainGetGuestInfoCheckSupport(unsigned int *types)
|
|
|
fbe740 |
*types = *types & supportedGuestInfoTypes;
|
|
|
fbe740 |
}
|
|
|
fbe740 |
|
|
|
fbe740 |
-/* Returns: 0 on success
|
|
|
fbe740 |
- * -1 otherwise
|
|
|
fbe740 |
- */
|
|
|
fbe740 |
-static int
|
|
|
fbe740 |
+static void
|
|
|
fbe740 |
qemuAgentFSInfoFormatParams(qemuAgentFSInfoPtr *fsinfo,
|
|
|
fbe740 |
int nfs,
|
|
|
fbe740 |
virDomainDefPtr vmdef,
|
|
|
fbe740 |
virTypedParameterPtr *params,
|
|
|
fbe740 |
int *nparams, int *maxparams)
|
|
|
fbe740 |
{
|
|
|
fbe740 |
- int ret = -1;
|
|
|
fbe740 |
size_t i, j;
|
|
|
fbe740 |
|
|
|
fbe740 |
/* FIXME: get disk target */
|
|
|
fbe740 |
|
|
|
fbe740 |
if (virTypedParamsAddUInt(params, nparams, maxparams,
|
|
|
fbe740 |
"fs.count", nfs) < 0)
|
|
|
fbe740 |
- goto cleanup;
|
|
|
fbe740 |
+ return;
|
|
|
fbe740 |
|
|
|
fbe740 |
for (i = 0; i < nfs; i++) {
|
|
|
fbe740 |
char param_name[VIR_TYPED_PARAM_FIELD_LENGTH];
|
|
|
fbe740 |
@@ -23021,17 +23017,17 @@ qemuAgentFSInfoFormatParams(qemuAgentFSInfoPtr *fsinfo,
|
|
|
fbe740 |
"fs.%zu.name", i);
|
|
|
fbe740 |
if (virTypedParamsAddString(params, nparams, maxparams,
|
|
|
fbe740 |
param_name, fsinfo[i]->name) < 0)
|
|
|
fbe740 |
- goto cleanup;
|
|
|
fbe740 |
+ return;
|
|
|
fbe740 |
g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
|
|
|
fbe740 |
"fs.%zu.mountpoint", i);
|
|
|
fbe740 |
if (virTypedParamsAddString(params, nparams, maxparams,
|
|
|
fbe740 |
param_name, fsinfo[i]->mountpoint) < 0)
|
|
|
fbe740 |
- goto cleanup;
|
|
|
fbe740 |
+ return;
|
|
|
fbe740 |
g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
|
|
|
fbe740 |
"fs.%zu.fstype", i);
|
|
|
fbe740 |
if (virTypedParamsAddString(params, nparams, maxparams,
|
|
|
fbe740 |
param_name, fsinfo[i]->fstype) < 0)
|
|
|
fbe740 |
- goto cleanup;
|
|
|
fbe740 |
+ return;
|
|
|
fbe740 |
|
|
|
fbe740 |
/* disk usage values are not returned by older guest agents, so
|
|
|
fbe740 |
* only add the params if the value is set */
|
|
|
fbe740 |
@@ -23040,20 +23036,20 @@ qemuAgentFSInfoFormatParams(qemuAgentFSInfoPtr *fsinfo,
|
|
|
fbe740 |
if (fsinfo[i]->total_bytes != -1 &&
|
|
|
fbe740 |
virTypedParamsAddULLong(params, nparams, maxparams,
|
|
|
fbe740 |
param_name, fsinfo[i]->total_bytes) < 0)
|
|
|
fbe740 |
- goto cleanup;
|
|
|
fbe740 |
+ return;
|
|
|
fbe740 |
|
|
|
fbe740 |
g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
|
|
|
fbe740 |
"fs.%zu.used-bytes", i);
|
|
|
fbe740 |
if (fsinfo[i]->used_bytes != -1 &&
|
|
|
fbe740 |
virTypedParamsAddULLong(params, nparams, maxparams,
|
|
|
fbe740 |
param_name, fsinfo[i]->used_bytes) < 0)
|
|
|
fbe740 |
- goto cleanup;
|
|
|
fbe740 |
+ return;
|
|
|
fbe740 |
|
|
|
fbe740 |
g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
|
|
|
fbe740 |
"fs.%zu.disk.count", i);
|
|
|
fbe740 |
if (virTypedParamsAddUInt(params, nparams, maxparams,
|
|
|
fbe740 |
param_name, fsinfo[i]->ndisks) < 0)
|
|
|
fbe740 |
- goto cleanup;
|
|
|
fbe740 |
+ return;
|
|
|
fbe740 |
for (j = 0; j < fsinfo[i]->ndisks; j++) {
|
|
|
fbe740 |
virDomainDiskDefPtr diskdef = NULL;
|
|
|
fbe740 |
qemuAgentDiskInfoPtr d = fsinfo[i]->disks[j];
|
|
|
fbe740 |
@@ -23069,7 +23065,7 @@ qemuAgentFSInfoFormatParams(qemuAgentFSInfoPtr *fsinfo,
|
|
|
fbe740 |
if (diskdef->dst &&
|
|
|
fbe740 |
virTypedParamsAddString(params, nparams, maxparams,
|
|
|
fbe740 |
param_name, diskdef->dst) < 0)
|
|
|
fbe740 |
- goto cleanup;
|
|
|
fbe740 |
+ return;
|
|
|
fbe740 |
}
|
|
|
fbe740 |
|
|
|
fbe740 |
g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
|
|
|
fbe740 |
@@ -23077,22 +23073,19 @@ qemuAgentFSInfoFormatParams(qemuAgentFSInfoPtr *fsinfo,
|
|
|
fbe740 |
if (d->serial &&
|
|
|
fbe740 |
virTypedParamsAddString(params, nparams, maxparams,
|
|
|
fbe740 |
param_name, d->serial) < 0)
|
|
|
fbe740 |
- goto cleanup;
|
|
|
fbe740 |
+ return;
|
|
|
fbe740 |
|
|
|
fbe740 |
g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
|
|
|
fbe740 |
"fs.%zu.disk.%zu.device", i, j);
|
|
|
fbe740 |
if (d->devnode &&
|
|
|
fbe740 |
virTypedParamsAddString(params, nparams, maxparams,
|
|
|
fbe740 |
param_name, d->devnode) < 0)
|
|
|
fbe740 |
- goto cleanup;
|
|
|
fbe740 |
+ return;
|
|
|
fbe740 |
}
|
|
|
fbe740 |
}
|
|
|
fbe740 |
- ret = nfs;
|
|
|
fbe740 |
-
|
|
|
fbe740 |
- cleanup:
|
|
|
fbe740 |
- return ret;
|
|
|
fbe740 |
}
|
|
|
fbe740 |
|
|
|
fbe740 |
+
|
|
|
fbe740 |
static int
|
|
|
fbe740 |
qemuDomainGetGuestInfo(virDomainPtr dom,
|
|
|
fbe740 |
unsigned int types,
|
|
|
fbe740 |
--
|
|
|
fbe740 |
2.25.1
|
|
|
fbe740 |
|