Re: [PATCH 05/36] conf: virdomainobjlist: Remove return value from virDomainObjListCollect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/5/23 10:29 AM, Peter Krempa wrote:
The function can't fail so there's no point in returning anything.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
  src/conf/virdomainobjlist.c | 7 ++-----
  src/conf/virdomainobjlist.h | 2 +-
  src/qemu/qemu_driver.c      | 7 +++----
  src/test/test_driver.c      | 4 +---
  src/vz/vz_driver.c          | 7 +++----
  5 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c
index 4968dfcf3e..13675acda5 100644
--- a/src/conf/virdomainobjlist.c
+++ b/src/conf/virdomainobjlist.c
@@ -964,7 +964,7 @@ virDomainObjListFilter(virDomainObj ***list,
  }


-int
+void
  virDomainObjListCollect(virDomainObjList *domlist,
                          virConnectPtr conn,
                          virDomainObj ***vms,
@@ -974,8 +974,6 @@ virDomainObjListCollect(virDomainObjList *domlist,
  {
      virDomainObjListCollectAll(domlist, vms, nvms);
      virDomainObjListFilter(vms, nvms, conn, filter, flags);
-
-    return 0;
  }


@@ -1046,8 +1044,7 @@ virDomainObjListExport(virDomainObjList *domlist,
      size_t i;
      int ret = -1;

-    if (virDomainObjListCollect(domlist, conn, &vms, &nvms, filter, flags) < 0)
-        return -1;
+    virDomainObjListCollect(domlist, conn, &vms, &nvms, filter, flags);

      if (domains) {
          doms = g_new0(virDomainPtr, nvms + 1);
diff --git a/src/conf/virdomainobjlist.h b/src/conf/virdomainobjlist.h
index 8c53680374..058f2c4ca6 100644
--- a/src/conf/virdomainobjlist.h
+++ b/src/conf/virdomainobjlist.h
@@ -149,7 +149,7 @@ void
  virDomainObjListCollectAll(virDomainObjList *domlist,
                             virDomainObj ***vms,
                             size_t *nvms);
-int
+void
  virDomainObjListCollect(virDomainObjList *doms,
                          virConnectPtr conn,
                          virDomainObj ***vms,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d509582719..1b3da86c81 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -18665,10 +18665,9 @@ qemuConnectGetAllDomainStats(virConnectPtr conn,
                                      lflags, true) < 0)
              return -1;
      } else {
-        if (virDomainObjListCollect(driver->domains, conn, &vms, &nvms,
-                                    virConnectGetAllDomainStatsCheckACL,
-                                    lflags) < 0)
-            return -1;
+        virDomainObjListCollect(driver->domains, conn, &vms, &nvms,
+                                virConnectGetAllDomainStatsCheckACL,
+                                lflags);
      }

      tmpstats = g_new0(virDomainStatsRecordPtr, nvms + 1);
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 6c21c6bcb4..bd6f063a00 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -9923,9 +9923,7 @@ testConnectGetAllDomainStats(virConnectPtr conn,
                                      &nvms, NULL, lflags, true) < 0)
              return -1;
      } else {
-        if (virDomainObjListCollect(driver->domains, conn, &vms, &nvms,
-                                    NULL, lflags) < 0)
-            return -1;
+        virDomainObjListCollect(driver->domains, conn, &vms, &nvms, NULL, lflags);
      }

      tmpstats = g_new0(virDomainStatsRecordPtr, nvms + 1);
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index d5147a6c0d..327704b375 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -3771,10 +3771,9 @@ vzConnectGetAllDomainStats(virConnectPtr conn,
                                      lflags, true) < 0)
              return -1;
      } else {
-        if (virDomainObjListCollect(driver->domains, conn, &doms, &ndoms,
-                                    virConnectGetAllDomainStatsCheckACL,
-                                    lflags) < 0)
-            return -1;
+        virDomainObjListCollect(driver->domains, conn, &doms, &ndoms,
+                                virConnectGetAllDomainStatsCheckACL,
+                                lflags);
      }

      tmpstats = g_new0(virDomainStatsRecordPtr, ndoms + 1);


Reviewed-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux