[libvirt] [PATCH 2/2] qemu: migration: Set the 'set' boolean in qemuMigrationParamsSetString

Peter Krempa posted 2 patches 7 years ago
[libvirt] [PATCH 2/2] qemu: migration: Set the 'set' boolean in qemuMigrationParamsSetString
Posted by Peter Krempa 7 years ago
The code setting TLS parameters verifies that TLS is supported by
looking at the dump of parameters which will be reset after migration,
but sets the parameters in the list of new parameters. As
qemuMigrationParamsSetString did not set the 'set' property, the TLS
parameters would not be used.

This is a regression after the series refactoring migration parameters
and it resulted into TLS not being used even when requested.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_migration_params.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index c5d7ab9016..578cd6671f 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -777,6 +777,15 @@ qemuMigrationParamsApply(virQEMUDriverPtr driver,
 }


+/**
+ * qemuMigrationParamsSetString:
+ * @migrParams: migration parameter object
+ * @param: parameter to set
+ * @value: new value
+ *
+ * Enables and sets the migration parameter @param in @migrParams. Returns 0 on
+ * success and -1 on error. Libvirt error is reported.
+ */
 static int
 qemuMigrationParamsSetString(qemuMigrationParamsPtr migParams,
                              qemuMigrationParam param,
@@ -788,6 +797,8 @@ qemuMigrationParamsSetString(qemuMigrationParamsPtr migParams,
     if (VIR_STRDUP(migParams->params[param].value.s, value) < 0)
         return -1;

+    migParams->params[param].set = true;
+
     return 0;
 }

-- 
2.16.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/2] qemu: migration: Set the 'set' boolean in qemuMigrationParamsSetString
Posted by Daniel P. Berrangé 7 years ago
On Fri, Apr 27, 2018 at 03:16:46PM +0200, Peter Krempa wrote:
> The code setting TLS parameters verifies that TLS is supported by
> looking at the dump of parameters which will be reset after migration,
> but sets the parameters in the list of new parameters. As
> qemuMigrationParamsSetString did not set the 'set' property, the TLS
> parameters would not be used.
> 
> This is a regression after the series refactoring migration parameters
> and it resulted into TLS not being used even when requested.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/qemu/qemu_migration_params.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/2] qemu: migration: Set the 'set' boolean in qemuMigrationParamsSetString
Posted by Ján Tomko 7 years ago
On Fri, Apr 27, 2018 at 03:16:46PM +0200, Peter Krempa wrote:
>The code setting TLS parameters verifies that TLS is supported by
>looking at the dump of parameters which will be reset after migration,
>but sets the parameters in the list of new parameters. As
>qemuMigrationParamsSetString did not set the 'set' property, the TLS
>parameters would not be used.
>
>This is a regression after the series refactoring migration parameters
>and it resulted into TLS not being used even when requested.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_migration_params.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
>diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
>index c5d7ab9016..578cd6671f 100644
>--- a/src/qemu/qemu_migration_params.c
>+++ b/src/qemu/qemu_migration_params.c
>@@ -777,6 +777,15 @@ qemuMigrationParamsApply(virQEMUDriverPtr driver,
> }
>
>
>+/**
>+ * qemuMigrationParamsSetString:
>+ * @migrParams: migration parameter object

s/migrP/migP/

>+ * @param: parameter to set
>+ * @value: new value
>+ *
>+ * Enables and sets the migration parameter @param in @migrParams. Returns 0 on

Here too.

Jano

>+ * success and -1 on error. Libvirt error is reported.
>+ */
> static int
> qemuMigrationParamsSetString(qemuMigrationParamsPtr migParams,
>                              qemuMigrationParam param,
>@@ -788,6 +797,8 @@ qemuMigrationParamsSetString(qemuMigrationParamsPtr migParams,
>     if (VIR_STRDUP(migParams->params[param].value.s, value) < 0)
>         return -1;
>
>+    migParams->params[param].set = true;
>+
>     return 0;
> }
>
>-- 
>2.16.2
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list