]> xenbits.xensource.com Git - libvirt.git/commitdiff
vz: move prlsdkCleanupBridgedNet after domain deletion
authorMaxim Nestratov <mnestratov@virtuozzo.com>
Tue, 22 Dec 2015 15:29:39 +0000 (18:29 +0300)
committerDmitry Guryanov <dguryanov@localhost.localdomain>
Thu, 24 Dec 2015 11:20:56 +0000 (14:20 +0300)
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.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
src/vz/vz_sdk.c

index 12c8be9be30306d2358c748a2429caf8ab2b2eec..fb6d3f441e7980877a8b97ea3b9312775a844695 100644 (file)
@@ -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;