[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH RDMA support v2: 4/6] initialize RDMA option
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH RDMA support v2: 4/6] initialize RDMA options when QEMU first runs on command-line |
Date: |
Mon, 18 Feb 2013 11:37:10 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
Il 11/02/2013 23:49, Michael R. Hines ha scritto:
> From: "Michael R. Hines" <address@hidden>
>
>
> Signed-off-by: Michael R. Hines <address@hidden>
> ---
> 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
[Qemu-devel] [RFC PATCH RDMA support v2: 3/6] install new monitor commands and setup RDMA capabilities, Michael R. Hines, 2013/02/11
[Qemu-devel] [RFC PATCH RDMA support v2: 2/6] create migration-rdma.c for core RDMA migration code, Michael R. Hines, 2013/02/11