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