On 6/19/19 1:18 PM, Ilias Stamatis wrote:
Signed-off-by: Ilias Stamatis <stamatis.iliass@xxxxxxxxx> --- src/test/test_driver.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 437df9cdf9..0c2cfdd2f7 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3409,10 +3409,10 @@ testDomainInterfaceAddresses(virDomainPtr dom, if (virDomainObjCheckActive(vm) < 0) goto cleanup; - if (VIR_ALLOC_N(ifaces_ret, vm->def->nnets) < 0) - goto cleanup; - for (i = 0; i < vm->def->nnets; i++) { + if (vm->def->nets[i]->type != VIR_DOMAIN_NET_TYPE_NETWORK) + continue; + if (VIR_ALLOC(iface) < 0) goto cleanup; @@ -3433,7 +3433,8 @@ testDomainInterfaceAddresses(virDomainPtr dom, iface->naddrs = 1; - VIR_APPEND_ELEMENT_INPLACE(ifaces_ret, ifaces_count, iface); + if (VIR_APPEND_ELEMENT(ifaces_ret, ifaces_count, iface) < 0) + goto cleanup; } VIR_STEAL_PTR(*ifaces, ifaces_ret);
I understand why you want this, but can't we keep the old behaviour for non-network interfaces?
Michal -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list