qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 06/12] Translate offsets to destination addre


From: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH v2 06/12] Translate offsets to destination address space
Date: Wed, 01 Jul 2015 10:43:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

"Dr. David Alan Gilbert (git)" <address@hidden> wrote:
> From: "Dr. David Alan Gilbert" <address@hidden>
>
> The 'offset' field in RDMACompress and 'current_addr' field
> in RDMARegister are commented as being offsets within a particular
> RAMBlock, however they appear to actually be offsets within the
> ram_addr_t space.
>
> The code currently assumes that the offsets on the source/destination
> match, this change removes the need for the assumption for these
> structures by translating the addresses into the ram_addr_t space of
> the destination host.
>
> Note: An alternative would be to change the fields to actually
> take the data they're commented for; this would potentially be
> simpler but would break stream compatibility for those cases
> that currently work.
>
> Signed-off-by: Dr. David Alan Gilbert <address@hidden>

Reviewed-by: Juan Quintela <address@hidden>


backwards compatibility, you will live with your errors forever....

> +        /*
> +         * 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;

I would add a function that is: rdma_adjust_offest() or something, but
it needs three pointer parameters, not sure that it is any easier :-(



reply via email to

[Prev in Thread] Current Thread [Next in Thread]