]> git.proxmox.com Git - mirror_qemu.git/commit
migration: remove unreachble RDMA code in save_hook impl
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 20 Jun 2022 11:01:47 +0000 (12:01 +0100)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 22 Jun 2022 17:11:21 +0000 (18:11 +0100)
commit246683c22f21df0572bd3ab756ac9e688e856cb1
tree4d31306a516ef66830d0691529c1c41660e294ba
parentc0e0825c98cf608fe2775395b79c53efe0324f8e
migration: remove unreachble RDMA code in save_hook impl

The QEMUFile 'save_hook' callback has a 'size_t size' parameter.

The RDMA impl of this has logic that takes different actions
depending on whether the value is zero or non-zero. It has
commented out logic that would have taken further actions
if the value was negative.

The only place where the 'save_hook' callback is invoked is
the ram_control_save_page() method, which passes 'size'
through from its caller. The only caller of this method is
in turn control_save_page(). This method unconditionally
passes the 'TARGET_PAGE_SIZE' constant for the 'size' parameter.

IOW, the only scenario for 'size' that can execute in the
qemu_rdma_save_page method is 'size > 0'. The remaining code
has been unreachable since RDMA support was first introduced
9 years ago.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/rdma.c