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 | 7 ++-----
src/conf/domain_conf.h | 4 +---
src/libxl/libxl_driver.c | 3 +--
src/lxc/lxc_driver.c | 3 +--
src/qemu/qemu_driver.c | 3 +--
src/vz/vz_sdk.c | 6 ++----
tests/qemublocktest.c | 5 +++--
7 files changed, 11 insertions(+), 20 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 54d6f890ef..6d0403b612 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17682,14 +17682,11 @@ virDomainDiskByTarget(virDomainDefPtr def,
}
-int virDomainDiskInsert(virDomainDefPtr def,
- virDomainDiskDefPtr disk)
+void virDomainDiskInsert(virDomainDefPtr def,
+ virDomainDiskDefPtr disk)
{
def->disks = g_renew(virDomainDiskDefPtr, def->disks, def->ndisks + 1);
-
virDomainDiskInsertPreAlloced(def, disk);
-
- return 0;
}
void virDomainDiskInsertPreAlloced(virDomainDefPtr def,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index c1f182af1b..92155ec305 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3354,9 +3354,7 @@ virDomainDiskDefPtr
virDomainDiskByTarget(virDomainDefPtr def,
const char *dst);
-int virDomainDiskInsert(virDomainDefPtr def,
- virDomainDiskDefPtr disk)
- G_GNUC_WARN_UNUSED_RESULT;
+void virDomainDiskInsert(virDomainDefPtr def, virDomainDiskDefPtr disk);
void virDomainDiskInsertPreAlloced(virDomainDefPtr def,
virDomainDiskDefPtr disk);
int virDomainStorageNetworkParseHost(xmlNodePtr hostnode,
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 2195ecf47b..176516f5cb 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3548,8 +3548,7 @@ libxlDomainAttachDeviceConfig(virDomainDefPtr vmdef,
virDomainDeviceDefPtr dev)
_("target %s already exists."), disk->dst);
return -1;
}
- if (virDomainDiskInsert(vmdef, disk) < 0)
- return -1;
+ virDomainDiskInsert(vmdef, disk);
/* vmdef has the pointer. Generic codes for vmdef will do all jobs */
dev->data.disk = NULL;
break;
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index a6905b5a54..d0503ef2ea 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3045,8 +3045,7 @@ lxcDomainAttachDeviceConfig(virDomainDefPtr vmdef,
_("target %s already exists."), disk->dst);
return -1;
}
- if (virDomainDiskInsert(vmdef, disk) < 0)
- return -1;
+ virDomainDiskInsert(vmdef, disk);
/* vmdef has the pointer. Generic codes for vmdef will do all jobs */
dev->data.disk = NULL;
ret = 0;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 591e3ec706..58c34cd472 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7233,8 +7233,7 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
return -1;
if (qemuCheckDiskConfigAgainstDomain(vmdef, disk) < 0)
return -1;
- if (virDomainDiskInsert(vmdef, disk) < 0)
- return -1;
+ virDomainDiskInsert(vmdef, disk);
/* vmdef has the pointer. Generic codes for vmdef will do all jobs */
dev->data.disk = NULL;
break;
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index cdd3f61ee1..00891dc16a 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -833,8 +833,7 @@ prlsdkAddDomainHardDisksInfo(vzDriverPtr driver, PRL_HANDLE sdkdom,
virDomainDef
if (prlsdkGetDiskInfo(driver, hdd, disk, false, IS_CT(def)) < 0)
goto error;
- if (virDomainDiskInsert(def, disk) < 0)
- goto error;
+ virDomainDiskInsert(def, disk);
disk = NULL;
PrlHandle_Free(hdd);
@@ -876,8 +875,7 @@ prlsdkAddDomainOpticalDisksInfo(vzDriverPtr driver, PRL_HANDLE sdkdom,
virDomain
PrlHandle_Free(cdrom);
cdrom = PRL_INVALID_HANDLE;
- if (virDomainDiskInsert(def, disk) < 0)
- goto error;
+ virDomainDiskInsert(def, disk);
}
return 0;
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index c39f96716f..14212daadf 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -278,10 +278,11 @@ testQemuDiskXMLToProps(const void *opaque)
VIR_DOMAIN_DEF_PARSE_STATUS)))
return -1;
- if (!(vmdef = virDomainDefNew()) ||
- virDomainDiskInsert(vmdef, disk) < 0)
+ if (!(vmdef = virDomainDefNew()))
return -1;
+ virDomainDiskInsert(vmdef, disk);
+
if (qemuValidateDomainDeviceDefDisk(disk, vmdef, data->qemuCaps) < 0) {
VIR_TEST_VERBOSE("invalid configuration for disk");
return -1;
--
2.27.0