summary refs log tree commit diff stats
path: root/migration/rdma.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2023-10-19 10:52:58 +0200
committerJuan Quintela <quintela@redhat.com>2023-10-30 17:41:55 +0100
commit413d64fedcc8e7f83b19ab4b79e3fd1f871f3564 (patch)
treec9bdb795adf0b1769673ab9c5936a82e31b08773 /migration/rdma.c
parente77326179d61585457f88ba0c5152cea5bbaabf0 (diff)
downloadfocaccia-qemu-413d64fedcc8e7f83b19ab4b79e3fd1f871f3564.tar.gz
focaccia-qemu-413d64fedcc8e7f83b19ab4b79e3fd1f871f3564.zip
migration: Receiving a zero page non zero is an error
We don't allow non zero compressed pages since:

commit 3edcd7e6ebae3ef0ac178eed5f4225803159562d
Author: Peter Lieven <pl@kamp.de>
Date:   Tue Mar 26 10:58:35 2013 +0100

    migration: search for zero instead of dup pages

RDMA case is a bit more complicated, but they don't handle it since:

commit a1febc4950f2c6232c002f401d7cd409f6fa6a88
Author: Richard Henderson <rth@twiddle.net>
Date:   Mon Aug 29 11:46:14 2016 -0700

    cutils: Export only buffer_is_zero

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231019085259.13307-2-quintela@redhat.com>
Diffstat (limited to 'migration/rdma.c')
-rw-r--r--migration/rdma.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/migration/rdma.c b/migration/rdma.c
index 2a1852ec7f..2d963fd147 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3592,7 +3592,11 @@ int rdma_registration_handle(QEMUFile *f)
 
             host_addr = block->local_host_addr +
                             (comp->offset - block->offset);
-
+            if (comp->value) {
+                error_report("rdma: Zero page with non-zero (%d) value",
+                             comp->value);
+                goto err;
+            }
             ram_handle_compressed(host_addr, comp->value, comp->length);
             break;