Patchwork [v2,4/5] Allow XBZRLE encoding without enabling the capability

login
register
mail settings
Submitter Orit Wasserman
Date Jan. 30, 2013, 11:41 a.m.
Message ID <1359546093-1472-5-git-send-email-owasserm@redhat.com>
Download mbox | patch
Permalink /patch/216850/
State New
Headers show

Comments

Orit Wasserman - Jan. 30, 2013, 11:41 a.m.
Before this fix we couldn't load a guest from
XBZRLE compressed file.

For example:
The user activated the XBZRLE capability
The user run migrate -d "exec:gzip -c > vm.gz"
The user won't be able to load vm.gz and get an error.

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
---
 arch_init.c | 3 ---
 1 file changed, 3 deletions(-)
Eric Blake - Jan. 30, 2013, 6:24 p.m.
On 01/30/2013 04:41 AM, Orit Wasserman wrote:
> Before this fix we couldn't load a guest from
> XBZRLE compressed file.

s/encoding/decoding/ in the subject line.

> 
> For example:
> The user activated the XBZRLE capability
> The user run migrate -d "exec:gzip -c > vm.gz"
> The user won't be able to load vm.gz and get an error.
> 
> Signed-off-by: Orit Wasserman <owasserm@redhat.com>
> ---
>  arch_init.c | 3 ---
>  1 file changed, 3 deletions(-)

Makes sense - be liberal in what you accept.

Reviewed-by: Eric Blake <eblake@redhat.com>

Patch

diff --git a/arch_init.c b/arch_init.c
index dada6de..8da868b 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -851,9 +851,6 @@  static int ram_load(QEMUFile *f, void *opaque, int version_id)
 
             qemu_get_buffer(f, host, TARGET_PAGE_SIZE);
         } else if (flags & RAM_SAVE_FLAG_XBZRLE) {
-            if (!migrate_use_xbzrle()) {
-                return -EINVAL;
-            }
             void *host = host_from_stream_offset(f, addr, flags);
             if (!host) {
                 return -EINVAL;