Il 11/02/2013 23:49, Michael R. Hines ha scritto: > From: "Michael R. Hines" <mrhi...@us.ibm.com> > > > Signed-off-by: Michael R. Hines <mrhi...@us.ibm.com> > --- > exec.c | 27 +++++++++++++++++++++++++++ > vl.c | 13 +++++++++++++ > 2 files changed, 40 insertions(+) > > diff --git a/exec.c b/exec.c > index b85508b..b7ac6fa 100644 > --- a/exec.c > +++ b/exec.c > @@ -25,6 +25,8 @@ > #endif > > #include "qemu-common.h" > +#include "qemu/rdma.h" > +#include "monitor/monitor.h" > #include "cpu.h" > #include "tcg.h" > #include "hw/hw.h" > @@ -104,6 +106,31 @@ static MemoryRegion io_mem_watch; > > #if !defined(CONFIG_USER_ONLY) > > +/* > + * Memory regions need to be registered with the device and queue pairs setup > + * in advanced before the migration starts. This tells us where the RAM > blocks > + * are so that we can register them individually. > + */ > +int rdma_init_ram_blocks(struct rdma_ram_blocks *rdma_ram_blocks) > +{ > + RAMBlock *block; > + int num_blocks = 0; > + > + memset(rdma_ram_blocks, 0, sizeof *rdma_ram_blocks); > + QTAILQ_FOREACH(block, &ram_list.blocks, next) { > + if (num_blocks >= RDMA_MAX_RAM_BLOCKS) { > + return -1; > + } > + rdma_ram_blocks->block[num_blocks].local_host_addr = block->host; > + rdma_ram_blocks->block[num_blocks].offset = (uint64_t)block->offset; > + rdma_ram_blocks->block[num_blocks].length = (uint64_t)block->length; > + num_blocks++; > + } > + rdma_ram_blocks->num_blocks = num_blocks; > + > + return 0; > +}
Memory regions are not static data, so you have to do this at the time migration starts. For the RDMA-impaired among us, why do you need a separate host+port? Can it be the same by default, and if it is different you can then specify it like rdma://host:port/?rdmahost=HOST&rdmaport=PORT Paolo