On Mon, Aug 17, 2026 at 10:24 PM Peter Xu <[email protected]> wrote:
>
> Not used anymore.
>
> Signed-off-by: Peter Xu <[email protected]>
Reviewed-by: Jack Wang <[email protected]>
> ---
> migration/rdma.c | 23 ++++++++++-------------
> 1 file changed, 10 insertions(+), 13 deletions(-)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index c06395a51a..f64bcee418 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -415,10 +415,7 @@ static void network_to_control(RDMAControlHeader
> *control)
> * the actual RDMA operation.
> */
> typedef struct QEMU_PACKED {
> - union QEMU_PACKED {
> - uint64_t current_addr; /* offset into the ram_addr_t space */
> - uint64_t chunk; /* chunk to lookup if unregistering */
> - } key;
> + uint64_t current_addr; /* offset into the ram_addr_t space */
> uint32_t current_index; /* which ramblock the chunk belongs to */
> uint32_t padding;
> uint64_t chunks; /* how many sequential chunks to register */
> @@ -443,16 +440,16 @@ static void register_to_network(RDMAContext *rdma,
> RDMARegister *reg)
> * current_addr as passed in is an address in the local ram_addr_t
> * space, we need to translate this for the destination
> */
> - reg->key.current_addr -= local_block->offset;
> - reg->key.current_addr += rdma->dest_blocks[reg->current_index].offset;
> - reg->key.current_addr = htonll(reg->key.current_addr);
> + reg->current_addr -= local_block->offset;
> + reg->current_addr += rdma->dest_blocks[reg->current_index].offset;
> + reg->current_addr = htonll(reg->current_addr);
> reg->current_index = htonl(reg->current_index);
> reg->chunks = htonll(reg->chunks);
> }
>
> static void network_to_register(RDMARegister *reg)
> {
> - reg->key.current_addr = ntohll(reg->key.current_addr);
> + reg->current_addr = ntohll(reg->current_addr);
> reg->current_index = ntohl(reg->current_index);
> reg->chunks = ntohll(reg->chunks);
> }
> @@ -1833,7 +1830,7 @@ retry:
> * Otherwise, tell other side to register.
> */
> reg.current_index = current_index;
> - reg.key.current_addr = current_addr;
> + reg.current_addr = current_addr;
> reg.chunks = chunks;
>
> trace_rdma_write_one_sendreg(chunk, sge.length, current_index,
> @@ -3375,7 +3372,7 @@ int rdma_registration_handle(QEMUFile *f)
> reg_result = &results[count];
>
> trace_rdma_registration_handle_register_loop(count,
> - reg->current_index, reg->key.current_addr,
> reg->chunks);
> + reg->current_index, reg->current_addr, reg->chunks);
>
> if (reg->current_index >= rdma->local_ram_blocks.nb_blocks) {
> error_report("rdma: 'register' bad block index %u (vs
> %d)",
> @@ -3384,15 +3381,15 @@ int rdma_registration_handle(QEMUFile *f)
> goto err;
> }
> block = &(rdma->local_ram_blocks.block[reg->current_index]);
> - if (block->offset > reg->key.current_addr) {
> + if (block->offset > reg->current_addr) {
> error_report("rdma: bad register address for block %s"
> " offset: %" PRIx64 " current_addr: %" PRIx64,
> block->block_name, block->offset,
> - reg->key.current_addr);
> + reg->current_addr);
> goto err;
> }
> host_addr = (block->local_host_addr +
> - (reg->key.current_addr - block->offset));
> + (reg->current_addr - block->offset));
> chunk = ram_chunk_index(block->local_host_addr,
> (uint8_t *) host_addr);
> chunk_start = ram_chunk_start(block, chunk);
> --
> 2.54.0
>