[PATCH v3 3/3] libxl: begin job on perform phase

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

 



Add a job LIBXL_JOB_MODIFY in the perform phase to prevent
changes to the domain from happening during migration.

Signed-off-by: Joao Martins <joao.m.martins@xxxxxxxxxx>
---
 src/libxl/libxl_driver.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 28220b2..73ed448 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -5341,18 +5341,25 @@ libxlDomainMigratePerform3Params(virDomainPtr dom,
     if (virDomainMigratePerform3ParamsEnsureACL(dom->conn, vm->def) < 0)
         goto cleanup;
 
+    if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0)
+        goto cleanup;
+
     if (flags & VIR_MIGRATE_PEER2PEER) {
         if (libxlDomainMigrationPerformP2P(driver, vm, dom->conn, dom_xml,
                                            dconnuri, uri, dname, flags) < 0)
-            goto cleanup;
+            goto endjob;
     } else {
         if (libxlDomainMigrationPerform(driver, vm, dom_xml, dconnuri,
                                         uri, dname, flags) < 0)
-            goto cleanup;
+            goto endjob;
     }
 
     ret = 0;
 
+ endjob:
+    if (!libxlDomainObjEndJob(driver, vm))
+        vm = NULL;
+
  cleanup:
     if (vm)
         virObjectUnlock(vm);
-- 
2.1.4

--
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]