[PATCH v3 3/5] vz: support domain rename on migrate

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

 



From: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---
 src/vz/vz_driver.c |    6 ++----
 src/vz/vz_sdk.c    |   16 +++++++++-------
 src/vz/vz_sdk.h    |    5 ++++-
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index f82fff8..dc26b09 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -1467,8 +1467,6 @@ vzMakeVzUri(const char *connuri_str)
 
 #define VZ_MIGRATION_FLAGS (0)
 
-#define VZ_MIGRATION_PARAMETERS (NULL)
-
 static int
 vzDomainMigratePerform3(virDomainPtr domain,
                         const char *xmlin ATTRIBUTE_UNUSED,
@@ -1479,7 +1477,7 @@ vzDomainMigratePerform3(virDomainPtr domain,
                         const char *dconnuri ATTRIBUTE_UNUSED,
                         const char *uri,
                         unsigned long flags,
-                        const char *dname ATTRIBUTE_UNUSED,
+                        const char *dname,
                         unsigned long bandwidth ATTRIBUTE_UNUSED)
 {
     int ret = -1;
@@ -1515,7 +1513,7 @@ vzDomainMigratePerform3(virDomainPtr domain,
     if (vzParseCookie(cookie, session_uuid) < 0)
         goto cleanup;
 
-    if (prlsdkMigrate(dom, vzuri, session_uuid) < 0)
+    if (prlsdkMigrate(dom, vzuri, session_uuid, dname) < 0)
         goto cleanup;
 
     virDomainObjListRemove(privconn->domains, dom);
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 783438d..89a2429 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -4064,7 +4064,8 @@ prlsdkGetMemoryStats(virDomainObjPtr dom,
 #define PRLSDK_MIGRATION_FLAGS (PSL_HIGH_SECURITY)
 
 int prlsdkMigrate(virDomainObjPtr dom, virURIPtr uri,
-                  const unsigned char *session_uuid)
+                  const unsigned char *session_uuid,
+                  const char *dname)
 {
     int ret = -1;
     vzDomObjPtr privdom = dom->privateData;
@@ -4072,12 +4073,13 @@ int prlsdkMigrate(virDomainObjPtr dom, virURIPtr uri,
     char uuidstr[VIR_UUID_STRING_BUFLEN + 2];
 
     prlsdkUUIDFormat(session_uuid, uuidstr);
-    job = PrlVm_MigrateEx(privdom->sdkdom, uri->server, uri->port, uuidstr,
-                          "", /* use default dir for migrated instance bundle */
-                          PRLSDK_MIGRATION_FLAGS,
-                          0, /* reserved flags */
-                          PRL_TRUE /* don't ask for confirmations */
-                          );
+    job = PrlVm_MigrateWithRenameEx(privdom->sdkdom, uri->server, uri->port, uuidstr,
+                                    dname == NULL ? "" : dname,
+                                    "", /* use default dir for migrated instance bundle */
+                                    PRLSDK_MIGRATION_FLAGS,
+                                    0, /* reserved flags */
+                                    PRL_TRUE /* don't ask for confirmations */
+                                    );
 
     if (PRL_FAILED(waitJob(job)))
         goto cleanup;
diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h
index d3f0caf..0aa70b3 100644
--- a/src/vz/vz_sdk.h
+++ b/src/vz/vz_sdk.h
@@ -77,4 +77,7 @@ prlsdkGetVcpuStats(virDomainObjPtr dom, int idx, unsigned long long *time);
 int
 prlsdkGetMemoryStats(virDomainObjPtr dom, virDomainMemoryStatPtr stats, unsigned int nr_stats);
 int
-prlsdkMigrate(virDomainObjPtr dom, virURIPtr uri, const char unsigned *session_uuid);
+prlsdkMigrate(virDomainObjPtr dom,
+              virURIPtr uri,
+              const char unsigned *session_uuid,
+              const char *dname);
-- 
1.7.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]