Every migration entry point in qemu_driver is supposed to call
qemuMigrationParamsFromFlags to transform flags and parameters into
qemuMigrationParams structure and pass the result to qemuMigration*
APIs.
Signed-off-by: Jiri Denemark
---
src/qemu/qemu_driver.c| 64 +++
src/qemu/qemu_migration.c | 23 ++
src/qemu/qemu_migration.h | 2 ++
3 files changed, 62 insertions(+), 27 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d8a641f77d..5271e01d92 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12126,6 +12126,7 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn,
virQEMUDriverPtr driver = dconn->privateData;
virDomainDefPtr def = NULL;
char *origname = NULL;
+qemuMigrationParamsPtr migParams = NULL;
int ret = -1;
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
@@ -12136,6 +12137,10 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn,
goto cleanup;
}
+if (!(migParams = qemuMigrationParamsFromFlags(NULL, 0, flags,
+
QEMU_MIGRATION_DESTINATION)))
+goto cleanup;
+
if (virLockManagerPluginUsesState(driver->lockManager)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot use migrate v2 protocol with lock manager
%s"),
@@ -12151,9 +12156,10 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn,
ret = qemuMigrationDstPrepareTunnel(driver, dconn,
NULL, 0, NULL, NULL, /* No cookies in
v2 */
-st, &def, origname, flags);
+st, &def, origname, migParams, flags);
cleanup:
+qemuMigrationParamsFree(migParams);
VIR_FREE(origname);
virDomainDefFree(def);
return ret;
@@ -12178,6 +12184,7 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
virDomainDefPtr def = NULL;
char *origname = NULL;
qemuMigrationCompressionPtr compression = NULL;
+qemuMigrationParamsPtr migParams = NULL;
int ret = -1;
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
@@ -12195,6 +12202,10 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
if (!(compression = qemuMigrationAnyCompressionParse(NULL, 0, flags)))
goto cleanup;
+if (!(migParams = qemuMigrationParamsFromFlags(NULL, 0, flags,
+
QEMU_MIGRATION_DESTINATION)))
+goto cleanup;
+
if (virLockManagerPluginUsesState(driver->lockManager)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot use migrate v2 protocol with lock manager
%s"),
@@ -12216,9 +12227,10 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
NULL, 0, NULL, NULL, /* No cookies */
uri_in, uri_out,
&def, origname, NULL, 0, NULL, 0,
-compression, flags);
+compression, migParams, flags);
cleanup:
+qemuMigrationParamsFree(migParams);
VIR_FREE(compression);
VIR_FREE(origname);
virDomainDefFree(def);
@@ -12252,10 +12264,11 @@ qemuDomainMigratePerform(virDomainPtr dom,
goto cleanup;
}
-if (!(migParams = qemuMigrationParamsNew()))
+if (!(compression = qemuMigrationAnyCompressionParse(NULL, 0, flags)))
goto cleanup;
-if (!(compression = qemuMigrationAnyCompressionParse(NULL, 0, flags)))
+if (!(migParams = qemuMigrationParamsFromFlags(NULL, 0, flags,
+ QEMU_MIGRATION_SOURCE)))
goto cleanup;
if (!(vm = qemuDomObjFromDomain(dom)))
@@ -12430,6 +12443,7 @@ qemuDomainMigratePrepare3(virConnectPtr dconn,
virDomainDefPtr def = NULL;
char *origname = NULL;
qemuMigrationCompressionPtr compression = NULL;
+qemuMigrationParamsPtr migParams = NULL;
int ret = -1;
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
@@ -12447,6 +12461,10 @@ qemuDomainMigratePrepare3(virConnectPtr dconn,
if (!(compression = qemuMigrationAnyCompressionParse(NULL, 0, flags)))
goto cleanup;
+if (!(migParams = qemuMigrationParamsFromFlags(NULL, 0, flags,
+
QEMU_MIGRATION_DESTINATION)))
+goto cleanup;
+
if (!(def = qemuMigrationAnyPrepareDef(driver, dom_xml, dname, &origname)))
goto cleanup;
@@ -12458,9 +12476,10 @@ qemuDomainMigratePrepare3(virConnectPtr dconn,
cookieout, cookieoutlen,
uri_in, uri_out,
&def, origname, NULL, 0, NULL, 0,
-compression, flags);
+compression, migParams, flags);
cleanup:
+qemuMigra