[PATCH] vz: fixup: do not touch domain cache on error path on migration finish step

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 We can not and should not sync domain cache on error path in finish step
of migration. We can not as we really don't know what is the reason of
cancelling and we should not as user should not make assumptions on
state on error path. What we should do is cleaning up temporary migration
state that is induced on prepare step but we don't have one. Thus
cancellation should be noop.

 So, please, fixup 5th patch of series and this patch into 4th one.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---
 src/vz/vz_driver.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index ae94d0b..9c93db1 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -2960,30 +2960,13 @@ vzDomainMigrateFinish3Params(virConnectPtr dconn,
     if (virTypedParamsValidate(params, nparams, VZ_MIGRATION_PARAMETERS) < 0)
         return NULL;
 
+    if (cancelled)
+        return NULL;
+
     if (virTypedParamsGetString(params, nparams,
                                 VIR_MIGRATE_PARAM_DEST_NAME, &name) < 0)
         return NULL;
 
-    if (cancelled) {
-        virObjectEventPtr event = NULL;
-
-        if (!(dom = virDomainObjListFindByName(driver->domains, name)))
-            return NULL;
-
-        event = virDomainEventLifecycleNewFromObj(dom,
-                                                  VIR_DOMAIN_EVENT_UNDEFINED,
-                                                  VIR_DOMAIN_EVENT_UNDEFINED_REMOVED);
-
-        if (event)
-            virObjectEventStateQueue(driver->domainEventState, event);
-
-        virDomainObjListRemove(driver->domains, dom);
-        virObjectUnref(dom);
-
-        return NULL;
-    }
-
-
     if (!(dom = prlsdkAddDomainByName(driver, name)))
         goto cleanup;
 
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]