Re: [PATCH v6 4/5] qemu: migration: support setting compession parameters

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

 



On Thu, Apr 14, 2016 at 13:33:51 +0300, Nikolay Shirokovskiy wrote:
> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
> ---
>  include/libvirt/libvirt-domain.h | 33 +++++++++++++++
>  src/qemu/qemu_migration.c        | 91 +++++++++++++++++++++++++++++++++++++++-
>  src/qemu/qemu_migration.h        |  9 ++++
>  3 files changed, 132 insertions(+), 1 deletion(-)
...
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 8fe0f0d..099ff92 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
...
> @@ -6663,6 +6727,7 @@ qemuMigrationCompressionDump(qemuMigrationCompressionPtr compression,
>                               unsigned long *flags)
>  {
>      size_t i;
> +    qemuMonitorMigrationCompressionPtr cparams = &compression->params;
>  
>      if (compression->methods == 1ULL << QEMU_MIGRATION_COMPRESS_XBZRLE) {

You should also check whether xbzrle_cache is set, otherwise you'd lose
that settings if only xbzrle method was chosen.

>          *flags |= VIR_MIGRATE_COMPRESSED;

ACK with the following trivial patch squashed in...

Jirka

diff --git i/src/qemu/qemu_migration.c w/src/qemu/qemu_migration.c
index 3e4243a..b9e5fc2 100644
--- i/src/qemu/qemu_migration.c
+++ w/src/qemu/qemu_migration.c
@@ -6700,7 +6700,7 @@ qemuMigrationCompressionParse(virTypedParameterPtr params,
 #undef GET_PARAM
 
     if ((cparams->level_set || cparams->threads_set || cparams->dthreads_set) &&
-        !(compression->methods & (1ULL << QEMU_MIGRATION_COMPRESS_MULTITHREAD))) {
+        !(compression->methods & (1ULL << QEMU_MIGRATION_COMPRESS_MT))) {
         virReportError(VIR_ERR_INVALID_ARG, "%s",
                        _("Turn multithread compression on to tune it"));
         goto error;
@@ -6733,7 +6733,8 @@ qemuMigrationCompressionDump(qemuMigrationCompressionPtr compression,
     size_t i;
     qemuMonitorMigrationCompressionPtr cparams = &compression->params;
 
-    if (compression->methods == 1ULL << QEMU_MIGRATION_COMPRESS_XBZRLE) {
+    if (compression->methods == 1ULL << QEMU_MIGRATION_COMPRESS_XBZRLE &&
+        !compression->xbzrle_cache_set) {
         *flags |= VIR_MIGRATE_COMPRESSED;
         return 0;
     }

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