virDomainNetInsert() returns nothing except 0. Changing return
type to void.
Found by Linux Verification Center (
linuxtesting.org) with SVACE.
Signed-off-by: Dmitry Frolov <frolov(a)swemel.ru>
---
src/conf/domain_conf.c | 3 +--
src/conf/domain_conf.h | 2 +-
src/libxl/libxl_driver.c | 3 +--
src/lxc/lxc_driver.c | 3 +--
src/qemu/qemu_driver.c | 3 +--
5 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9116b28360..e232d635bb 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14558,14 +14558,13 @@ virDomainDiskRemoveByName(virDomainDef *def, const char *name)
return virDomainDiskRemove(def, idx);
}
-int virDomainNetInsert(virDomainDef *def, virDomainNetDef *net)
+void virDomainNetInsert(virDomainDef *def, virDomainNetDef *net)
{
/* hostdev net devices must also exist in the hostdevs array */
if (net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV)
virDomainHostdevInsert(def, &net->data.hostdev.def);
VIR_APPEND_ELEMENT(def->nets, def->nnets, net);
- return 0;
}
/**
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index f3d32fe40c..89257d33fc 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3892,7 +3892,7 @@ int virDomainNetFindIdx(virDomainDef *def, virDomainNetDef *net);
virDomainNetDef *virDomainNetFind(virDomainDef *def, const char *device);
virDomainNetDef *virDomainNetFindByName(virDomainDef *def, const char *ifname);
bool virDomainHasNet(virDomainDef *def, virDomainNetDef *net);
-int virDomainNetInsert(virDomainDef *def, virDomainNetDef *net);
+void virDomainNetInsert(virDomainDef *def, virDomainNetDef *net);
void virDomainNetUpdate(virDomainDef *def, size_t netidx, virDomainNetDef *newnet);
bool virDomainNetBackendIsEqual(virDomainNetBackend *src,
virDomainNetBackend *dst);
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index f8ef3f2688..68aecaef8c 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3559,8 +3559,7 @@ libxlDomainAttachDeviceConfig(virDomainDef *vmdef,
virDomainDeviceDef *dev)
virMacAddrFormat(&net->mac, mac));
return -1;
}
- if (virDomainNetInsert(vmdef, net))
- return -1;
+ virDomainNetInsert(vmdef, net);
dev->data.net = NULL;
break;
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index b2e04dc532..017b166341 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3010,8 +3010,7 @@ lxcDomainAttachDeviceConfig(virDomainDef *vmdef,
case VIR_DOMAIN_DEVICE_NET:
net =
dev->data.net;
- if (virDomainNetInsert(vmdef, net) < 0)
- return -1;
+ virDomainNetInsert(vmdef, net);
dev->data.net = NULL;
ret = 0;
break;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 90b965b5fa..830843e96e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6704,8 +6704,7 @@ qemuDomainAttachDeviceConfig(virDomainDef *vmdef,
case VIR_DOMAIN_DEVICE_NET:
net =
dev->data.net;
- if (virDomainNetInsert(vmdef, net))
- return -1;
+ virDomainNetInsert(vmdef, net);
dev->data.net = NULL;
break;
--
2.34.1