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