[PATCH v2 02/11] migration: Give one error if trying to set COMPRESSION and XBZRLE

Juan Quintela posted 11 patches 2 years, 3 months ago
Maintainers: Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Leonardo Bras <leobras@redhat.com>
[PATCH v2 02/11] migration: Give one error if trying to set COMPRESSION and XBZRLE
Posted by Juan Quintela 2 years, 3 months ago
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/options.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/migration/options.c b/migration/options.c
index b8c3c3218d..37fa1cfe74 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -625,6 +625,13 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp)
         }
     }
 
+    if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) {
+        if (new_caps[MIGRATION_CAPABILITY_XBZRLE]) {
+            error_setg(errp, "Compression is not compatible with xbzrle");
+            return false;
+        }
+    }
+
     return true;
 }
 
-- 
2.41.0
Re: [PATCH v2 02/11] migration: Give one error if trying to set COMPRESSION and XBZRLE
Posted by Fabiano Rosas 2 years, 3 months ago
Juan Quintela <quintela@redhat.com> writes:

> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  migration/options.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/migration/options.c b/migration/options.c
> index b8c3c3218d..37fa1cfe74 100644
> --- a/migration/options.c
> +++ b/migration/options.c
> @@ -625,6 +625,13 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp)
>          }
>      }
>  
> +    if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) {
> +        if (new_caps[MIGRATION_CAPABILITY_XBZRLE]) {
> +            error_setg(errp, "Compression is not compatible with xbzrle");
> +            return false;
> +        }
> +    }
> +
>      return true;
>  }

Reviewed-by: Fabiano Rosas <farosas@suse.de>