aboutsummaryrefslogtreecommitdiff
path: root/migration-rdma.c
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@private.email.ne.jp>2013-09-04 11:32:19 +0900
committerJuan Quintela <quintela@trasno.org>2013-09-24 13:22:50 +0200
commitdd286ed700c6ca2768ac3452bc5b79af1709296a (patch)
treeaa3df2f840b4bafa4110ba2cb723420e980f892c /migration-rdma.c
parent5a91337cdf343b94474f8bbecab85a8c00f6d2a1 (diff)
rdma: constify ram_chunk_{index, start, end}
Signed-off-by: Isaku Yamahata <yamahata@private.email.ne.jp> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration-rdma.c')
-rw-r--r--migration-rdma.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/migration-rdma.c b/migration-rdma.c
index 3679acb4d0..f94f3b4e3a 100644
--- a/migration-rdma.c
+++ b/migration-rdma.c
@@ -511,19 +511,21 @@ static int qemu_rdma_exchange_send(RDMAContext *rdma, RDMAControlHeader *head,
int *resp_idx,
int (*callback)(RDMAContext *rdma));
-static inline uint64_t ram_chunk_index(uint8_t *start, uint8_t *host)
+static inline uint64_t ram_chunk_index(const uint8_t *start,
+ const uint8_t *host)
{
return ((uintptr_t) host - (uintptr_t) start) >> RDMA_REG_CHUNK_SHIFT;
}
-static inline uint8_t *ram_chunk_start(RDMALocalBlock *rdma_ram_block,
+static inline uint8_t *ram_chunk_start(const RDMALocalBlock *rdma_ram_block,
uint64_t i)
{
return (uint8_t *) (((uintptr_t) rdma_ram_block->local_host_addr)
+ (i << RDMA_REG_CHUNK_SHIFT));
}
-static inline uint8_t *ram_chunk_end(RDMALocalBlock *rdma_ram_block, uint64_t i)
+static inline uint8_t *ram_chunk_end(const RDMALocalBlock *rdma_ram_block,
+ uint64_t i)
{
uint8_t *result = ram_chunk_start(rdma_ram_block, i) +
(1UL << RDMA_REG_CHUNK_SHIFT);