This function always returns zero, so it might as well be void.
Signed-off-by: Matt Coleman <matt(a)datto.com>
---
src/conf/domain_conf.c | 6 ++----
src/conf/domain_conf.h | 3 +--
src/qemu/qemu_hotplug.c | 3 +--
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 987992efa6..355bcca66d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -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;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 83dfd6ac3e..1b5dbc57e2 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -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
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 81bbe178a9..c1461ac621 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -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) {
--
2.27.0