[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v3 10/19] fix live-migration when "populated=on"
From: |
Vasilis Liaskovitis |
Subject: |
[Qemu-devel] [RFC PATCH v3 10/19] fix live-migration when "populated=on" is missing |
Date: |
Fri, 21 Sep 2012 13:17:26 +0200 |
Live migration works after memory hot-add events, as long as the
qemu command line "-dimm" arguments are changed on the destination host
to specify "populated=on" for the dimms that have been hot-added.
If a command-line change has not occured, the destination host does not yet
have the corresponding ramblock in its ram_list. Activate the dimm on the
destination during ram_load.
Perhaps several fields of the DimmDevice should be part of a
VMStateDescription to handle migration in a cleaner way. But the problem
is that ramblocks are checked before qdev vmstates.
Signed-off-by: Vasilis Liaskovitis <address@hidden>
---
arch_init.c | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 5a1173e..b63caa7 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -45,6 +45,7 @@
#include "hw/pcspk.h"
#include "qemu/page_cache.h"
#include "qmp-commands.h"
+#include "hw/dimm.h"
#ifdef DEBUG_ARCH_INIT
#define DPRINTF(fmt, ...) \
@@ -740,10 +741,27 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
}
if (!block) {
- fprintf(stderr, "Unknown ramblock \"%s\", cannot "
+ /* this can happen if a dimm was hot-added at source
host */
+ bool ramblock_found = false;
+ if (dimm_add(id)) {
+ fprintf(stderr, "Cannot add unknown ramblock
\"%s\", "
+ "cannot accept migration\n", id);
+ ret = -EINVAL;
+ goto done;
+ }
+ /* rescan ram_list, verify ramblock is there now */
+ QLIST_FOREACH(block, &ram_list.blocks, next) {
+ if (!strncmp(id, block->idstr, sizeof(id))) {
+ ramblock_found = true;
+ break;
+ }
+ }
+ if (!ramblock_found) {
+ fprintf(stderr, "Unknown ramblock \"%s\", cannot "
"accept migration\n", id);
- ret = -EINVAL;
- goto done;
+ ret = -EINVAL;
+ goto done;
+ }
}
total_ram_bytes -= length;
--
1.7.9
- Re: [Qemu-devel] [RFC PATCH v3 08/19] pc: calculate dimm physical addresses and adjust memory map, (continued)
- [Qemu-devel] [RFC PATCH v3 09/19] pc: Add dimm paravirt SRAT info, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 11/19] Implement qmp and hmp commands for notification lists, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 12/19] Implement "info memory-total" and "query-memory-total", Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 17/19][SeaBIOS] Implement _PS3 method for memory device, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 15/19] Add _OST dimm support, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 18/19] Implement _PS3 for dimm, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 13/19] balloon: update with hotplugged memory, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 10/19] fix live-migration when "populated=on" is missing,
Vasilis Liaskovitis <=
- [Qemu-devel] [RFC PATCH v3 14/19][SeaBIOS] Add _OST dimm method, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 16/19] Update dimm state on reset, Vasilis Liaskovitis, 2012/09/21
- [Qemu-devel] [RFC PATCH v3 19/19][SeaBIOS] Calculate pcimem_start and pcimem64_start from SRAT entries, Vasilis Liaskovitis, 2012/09/21
- Re: [Qemu-devel] [RFC PATCH v3 19/19][SeaBIOS] Calculate pcimem_start and pcimem64_start from SRAT entries, Wen Congyang, 2012/09/24
- Re: [Qemu-devel] [RFC PATCH v3 00/19] ACPI memory hotplug, Blue Swirl, 2012/09/22