On Mon, Oct 21, 2019 at 03:18:55PM -0300, Daniel Henrique Barboza wrote:
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/lxc/lxc_cgroup.c | 70 ++++++++++++++++------------------------
src/lxc/lxc_container.c | 17 ++++------
src/lxc/lxc_controller.c | 44 +++++++++++--------------
src/lxc/lxc_driver.c | 39 +++++++++-------------
src/lxc/lxc_process.c | 34 ++++++++-----------
5 files changed, 81 insertions(+), 123 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 41a6a446bd..5caef1a472 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3440,7 +3440,7 @@ lxcDomainAttachDeviceConfig(virDomainDefPtr vmdef,
case VIR_DOMAIN_DEVICE_NET:
net =
dev->data.net;
if (virDomainNetInsert(vmdef, net) < 0)
- goto cleanup;
+ return ret;
This should be return -1;
dev->data.net = NULL;
ret = 0;
break;
@@ -3464,7 +3464,6 @@ lxcDomainAttachDeviceConfig(virDomainDefPtr vmdef,
break;
}
- cleanup:
return ret;
}
@@ -3482,7 +3481,7 @@ lxcDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
case VIR_DOMAIN_DEVICE_NET:
net =
dev->data.net;
if ((idx = virDomainNetFindIdx(vmdef, net)) < 0)
- goto cleanup;
+ return -1;
oldDev.data.net = vmdef->nets[idx];
if (virDomainDefCompatibleDevice(vmdef, dev, &oldDev,
@@ -3505,7 +3504,6 @@ lxcDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
break;
}
- cleanup:
return ret;
}
@@ -3535,7 +3533,7 @@ lxcDomainDetachDeviceConfig(virDomainDefPtr vmdef,
case VIR_DOMAIN_DEVICE_NET:
net =
dev->data.net;
if ((idx = virDomainNetFindIdx(vmdef, net)) < 0)
- goto cleanup;
+ return ret;
Same here.
/* this is guaranteed to succeed */
virDomainNetDefFree(virDomainNetRemove(vmdef, idx));
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano