[libvirt] [PATCH v2 31/73] qemu: Move ParamsCheck closer to ParamsApply on Dst side

Jiri Denemark posted 73 patches 7 years, 1 month ago
[libvirt] [PATCH v2 31/73] qemu: Move ParamsCheck closer to ParamsApply on Dst side
Posted by Jiri Denemark 7 years, 1 month ago
We reached the point when qemuMigrationParamsApply is the only API which
sends migration parameters and capabilities to QEMU. Thus all but the
TLS parameters can be set before we ask QEMU for the current values of
all parameters in qemuMigrationParamsCheck.

Supported migration capabilities are queried as soon as libvirt connects
to QEMU monitor so we can check them anytime.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_migration.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 476417c15d..c97911039d 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2380,25 +2380,9 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
         dataFD[1] = -1; /* 'st' owns the FD now & will close it */
     }
 
-    if (qemuMigrationParamsCheck(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
-        goto stopjob;
-
     if (qemuMigrationParamsSetCompression(vm, compression, migParams) < 0)
         goto stopjob;
 
-    /* Migrations using TLS need to add the "tls-creds-x509" object and
-     * set the migration TLS parameters */
-    if (flags & VIR_MIGRATE_TLS) {
-        if (qemuMigrationParamsEnableTLS(driver, vm, true,
-                                         QEMU_ASYNC_JOB_MIGRATION_IN,
-                                         &tlsAlias, &secAlias, NULL,
-                                         migParams) < 0)
-            goto stopjob;
-    } else {
-        if (qemuMigrationParamsDisableTLS(vm, migParams) < 0)
-            goto stopjob;
-    }
-
     if (STREQ_NULLABLE(protocol, "rdma") &&
         virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit << 10) < 0) {
         goto stopjob;
@@ -2414,6 +2398,22 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
                                        migParams) < 0)
         goto stopjob;
 
+    if (qemuMigrationParamsCheck(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
+        goto stopjob;
+
+    /* Migrations using TLS need to add the "tls-creds-x509" object and
+     * set the migration TLS parameters */
+    if (flags & VIR_MIGRATE_TLS) {
+        if (qemuMigrationParamsEnableTLS(driver, vm, true,
+                                         QEMU_ASYNC_JOB_MIGRATION_IN,
+                                         &tlsAlias, &secAlias, NULL,
+                                         migParams) < 0)
+            goto stopjob;
+    } else {
+        if (qemuMigrationParamsDisableTLS(vm, migParams) < 0)
+            goto stopjob;
+    }
+
     if (qemuMigrationParamsApply(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
                                  migParams) < 0)
         goto stopjob;
-- 
2.17.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 31/73] qemu: Move ParamsCheck closer to ParamsApply on Dst side
Posted by Ján Tomko 7 years, 1 month ago
On Wed, Apr 11, 2018 at 04:41:21PM +0200, Jiri Denemark wrote:
>We reached the point when qemuMigrationParamsApply is the only API which
>sends migration parameters and capabilities to QEMU. Thus all but the
>TLS parameters can be set before we ask QEMU for the current values of
>all parameters in qemuMigrationParamsCheck.
>
>Supported migration capabilities are queried as soon as libvirt connects
>to QEMU monitor so we can check them anytime.
>
>Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
>---
> src/qemu/qemu_migration.c | 32 ++++++++++++++++----------------
> 1 file changed, 16 insertions(+), 16 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

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