On Tue, 2015-12-22 at 18:29 +0300, Maxim Nestratov wrote:
prlsdkCleanupBridgedNet call should be made strongly after
any actual domain deletion accurs. By doing this we avoid
any potential problems connected with second undefine call
when it is made after first one fails by some reason, and
we detect that network is already deleted.
ACK
Signed-off-by: Maxim Nestratov <mnestratov(a)virtuozzo.com>
---
src/vz/vz_sdk.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 12c8be9..fb6d3f4 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -3765,8 +3765,6 @@ prlsdkUnregisterDomain(vzConnPtr privconn, virDomainObjPtr
dom)
PRL_HANDLE job;
size_t i;
- for (i = 0; i < dom->def->nnets; i++)
- prlsdkCleanupBridgedNet(privconn, dom->def->nets[i]);
if (prlsdkDetachDomainHardDisks(privdom->sdkdom))
return -1;
@@ -3775,6 +3773,9 @@ prlsdkUnregisterDomain(vzConnPtr privconn, virDomainObjPtr
dom)
if (PRL_FAILED(waitJob(job)))
return -1;
+ for (i = 0; i < dom->def->nnets; i++)
+ prlsdkCleanupBridgedNet(privconn, dom->def->nets[i]);
+
if (prlsdkSendEvent(privconn, dom, VIR_DOMAIN_EVENT_UNDEFINED,
VIR_DOMAIN_EVENT_UNDEFINED_REMOVED) < 0)
return -1;