conf: virDomainNetUpdate() to void

virDomainNetUpdate() return value is invariant, so change it type
and remove all dependent checks.

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Artem Chernyshev 2024-01-04 03:17:00 +03:00 committed by Michal Privoznik
parent 270e363046
commit 88903f9abf
4 changed files with 4 additions and 7 deletions

View File

@ -14690,7 +14690,7 @@ virDomainNetRemoveByObj(virDomainDef *def, virDomainNetDef *net)
} }
int void
virDomainNetUpdate(virDomainDef *def, virDomainNetUpdate(virDomainDef *def,
size_t netidx, size_t netidx,
virDomainNetDef *newnet) virDomainNetDef *newnet)
@ -14725,7 +14725,6 @@ virDomainNetUpdate(virDomainDef *def,
} }
def->nets[netidx] = newnet; def->nets[netidx] = newnet;
return 0;
} }

View File

@ -3891,7 +3891,7 @@ virDomainNetDef *virDomainNetFind(virDomainDef *def, const char *device);
virDomainNetDef *virDomainNetFindByName(virDomainDef *def, const char *ifname); virDomainNetDef *virDomainNetFindByName(virDomainDef *def, const char *ifname);
bool virDomainHasNet(virDomainDef *def, virDomainNetDef *net); bool virDomainHasNet(virDomainDef *def, virDomainNetDef *net);
int virDomainNetInsert(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, bool virDomainNetBackendIsEqual(virDomainNetBackend *src,
virDomainNetBackend *dst); virDomainNetBackend *dst);
int virDomainNetDHCPInterfaces(virDomainDef *def, virDomainInterfacePtr **ifaces); int virDomainNetDHCPInterfaces(virDomainDef *def, virDomainInterfacePtr **ifaces);

View File

@ -3084,8 +3084,7 @@ lxcDomainUpdateDeviceConfig(virDomainDef *vmdef,
false) < 0) false) < 0)
return -1; return -1;
if (virDomainNetUpdate(vmdef, idx, net) < 0) virDomainNetUpdate(vmdef, idx, net);
return -1;
virDomainNetDefFree(oldDev.data.net); virDomainNetDefFree(oldDev.data.net);
dev->data.net = NULL; dev->data.net = NULL;

View File

@ -7145,8 +7145,7 @@ qemuDomainUpdateDeviceConfig(virDomainDef *vmdef,
false) < 0) false) < 0)
return -1; return -1;
if (virDomainNetUpdate(vmdef, pos, net)) virDomainNetUpdate(vmdef, pos, net);
return -1;
virDomainNetDefFree(oldDev.data.net); virDomainNetDefFree(oldDev.data.net);
dev->data.net = NULL; dev->data.net = NULL;