diff mbox series

[01/18] migration: Give one error if trying to set MULTIFD and XBZRLE

Message ID 20230613145757.10131-2-quintela@redhat.com
State New
Headers show
Series Migration compression cleanup | expand

Commit Message

Juan Quintela June 13, 2023, 2:57 p.m. UTC
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/options.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Lukas Straub June 22, 2023, 11:36 a.m. UTC | #1
On Tue, 13 Jun 2023 16:57:40 +0200
Juan Quintela <quintela@redhat.com> wrote:

> 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 b62ab30cd5..c6674a4753 100644
> --- a/migration/options.c
> +++ b/migration/options.c
> @@ -547,6 +547,13 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp)
>          }
>      }
>  
> +    if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) {
> +        if (new_caps[MIGRATION_CAPABILITY_XBZRLE]) {
> +            error_setg(errp, "Multifd is not compatible with xbzrle");
> +            return false;
> +        }
> +    }
> +
>      return true;
>  }
>  

Hmm, I think supporting xbzrle + multifd might be worthwhile as an
alternative to xbzrle + compress.
I don't use it, but it should be easy to do by just letting xbzlre try
to handle the page before multifd. 
There shouldn't be any incompatibilities other than that, as long as
xbzlre sees the pages before multifd and the zero-page case is still
handled the old way.

Best Regards,
Lukas Straub
Juan Quintela June 22, 2023, 12:15 p.m. UTC | #2
Lukas Straub <lukasstraub2@web.de> wrote:
> On Tue, 13 Jun 2023 16:57:40 +0200
> Juan Quintela <quintela@redhat.com> wrote:
>
>> 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 b62ab30cd5..c6674a4753 100644
>> --- a/migration/options.c
>> +++ b/migration/options.c
>> @@ -547,6 +547,13 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp)
>>          }
>>      }
>>  
>> +    if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) {
>> +        if (new_caps[MIGRATION_CAPABILITY_XBZRLE]) {
>> +            error_setg(errp, "Multifd is not compatible with xbzrle");
>> +            return false;
>> +        }
>> +    }
>> +
>>      return true;
>>  }
>>  
>
> Hmm, I think supporting xbzrle + multifd might be worthwhile as an
> alternative to xbzrle + compress.

Nack.

> I don't use it, but it should be easy to do by just letting xbzlre try
> to handle the page before multifd.

My idea here is to implement xbzrle as we implement zlib/zstd on
multifd.  Just go from there.

> There shouldn't be any incompatibilities other than that, as long as
> xbzlre sees the pages before multifd and the zero-page case is still
> handled the old way.

The way that I say is going to be easier and probably also faster.

Later, Juan.
diff mbox series

Patch

diff --git a/migration/options.c b/migration/options.c
index b62ab30cd5..c6674a4753 100644
--- a/migration/options.c
+++ b/migration/options.c
@@ -547,6 +547,13 @@  bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp)
         }
     }
 
+    if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) {
+        if (new_caps[MIGRATION_CAPABILITY_XBZRLE]) {
+            error_setg(errp, "Multifd is not compatible with xbzrle");
+            return false;
+        }
+    }
+
     return true;
 }