]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain_conf: make virDomainLeaseInsertPreAlloc() void
authorMatt Coleman <mcoleman@datto.com>
Fri, 6 Nov 2020 03:33:00 +0000 (22:33 -0500)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 11 Nov 2020 11:53:11 +0000 (12:53 +0100)
This function always returns zero, so it might as well be void.

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h
src/qemu/qemu_hotplug.c

index 7603f08184b60a8feb7e0a60aede5b6efa5a8e75..4793a4dc4d81a9d4fa411311643e6de396f6305d 100644 (file)
@@ -18272,17 +18272,15 @@ int virDomainLeaseIndex(virDomainDefPtr def,
 }
 
 
-int virDomainLeaseInsertPreAlloc(virDomainDefPtr def)
+void virDomainLeaseInsertPreAlloc(virDomainDefPtr def)
 {
     def->leases = g_renew(virDomainLeaseDefPtr, def->leases, def->nleases + 1);
-    return 0;
 }
 
 int virDomainLeaseInsert(virDomainDefPtr def,
                          virDomainLeaseDefPtr lease)
 {
-    if (virDomainLeaseInsertPreAlloc(def) < 0)
-        return -1;
+    virDomainLeaseInsertPreAlloc(def);
 
     virDomainLeaseInsertPreAlloced(def, lease);
     return 0;
index d1e05b375581cbb905abe6862da7cdcfcec8da7e..e6a315aa227a7541e04bf8ce583c9b89d900c073 100644 (file)
@@ -3434,8 +3434,7 @@ int virDomainLeaseIndex(virDomainDefPtr def,
                         virDomainLeaseDefPtr lease);
 int virDomainLeaseInsert(virDomainDefPtr def,
                          virDomainLeaseDefPtr lease);
-int virDomainLeaseInsertPreAlloc(virDomainDefPtr def)
-    G_GNUC_WARN_UNUSED_RESULT;
+void virDomainLeaseInsertPreAlloc(virDomainDefPtr def);
 void virDomainLeaseInsertPreAlloced(virDomainDefPtr def,
                                     virDomainLeaseDefPtr lease);
 virDomainLeaseDefPtr
index 81bbe178a9fc6ee4f1573f3d7e5ce14babc4ac33..c1461ac6217dcdd69ff71f18357401ccf385fbff 100644 (file)
@@ -3321,8 +3321,7 @@ qemuDomainAttachLease(virQEMUDriverPtr driver,
 {
     g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
 
-    if (virDomainLeaseInsertPreAlloc(vm->def) < 0)
-        return -1;
+    virDomainLeaseInsertPreAlloc(vm->def);
 
     if (virDomainLockLeaseAttach(driver->lockManager, cfg->uri,
                                  vm, lease) < 0) {