virDomainNetUpdate() return value
is invariant, so change it type and remove all dependent
checks.
Fixes: 98f6f2081d ("util: alloc: Reimplement VIR_APPEND_ELEMENT using
virAppendElement")
Signed-off-by: Artem Chernyshev <artem.chernyshev(a)red-soft.ru>
---
src/conf/domain_conf.c | 3 +--
src/conf/domain_conf.h | 2 +-
src/lxc/lxc_driver.c | 3 +--
src/qemu/qemu_driver.c | 3 +--
4 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 82672b30a0..39e9879a8a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14690,7 +14690,7 @@ virDomainNetRemoveByObj(virDomainDef *def, virDomainNetDef *net)
}
-int
+void
virDomainNetUpdate(virDomainDef *def,
size_t netidx,
virDomainNetDef *newnet)
@@ -14725,7 +14725,6 @@ virDomainNetUpdate(virDomainDef *def,
}
def->nets[netidx] = newnet;
- return 0;
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 14901b37ba..58b2c92f4c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3891,7 +3891,7 @@ 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);
-int virDomainNetUpdate(virDomainDef *def, size_t netidx, virDomainNetDef *newnet);
+void virDomainNetUpdate(virDomainDef *def, size_t netidx, virDomainNetDef *newnet);
bool virDomainNetBackendIsEqual(virDomainNetBackend *src,
virDomainNetBackend *dst);
int virDomainNetDHCPInterfaces(virDomainDef *def, virDomainInterfacePtr **ifaces);
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 25cbfc57c9..3e9c1395bf 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3084,8 +3084,7 @@ lxcDomainUpdateDeviceConfig(virDomainDef *vmdef,
false) < 0)
return -1;
- if (virDomainNetUpdate(vmdef, idx, net) < 0)
- return -1;
+ virDomainNetUpdate(vmdef, idx, net);
virDomainNetDefFree(oldDev.data.net);
dev->data.net = NULL;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0b7b320648..ee7774f115 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7145,8 +7145,7 @@ qemuDomainUpdateDeviceConfig(virDomainDef *vmdef,
false) < 0)
return -1;
- if (virDomainNetUpdate(vmdef, pos, net))
- return -1;
+ virDomainNetUpdate(vmdef, pos, net);
virDomainNetDefFree(oldDev.data.net);
dev->data.net = NULL;
--
2.43.0