[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v2 12/21] fix live-migration when "populated=on"
From: |
Vasilis Liaskovitis |
Subject: |
[Qemu-devel] [RFC PATCH v2 12/21] fix live-migration when "populated=on" is missing |
Date: |
Wed, 11 Jul 2012 12:31:57 +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 memslot on the
destination during ram_load.
Perhaps several fields of the DimmState struct should be part of a
VMStateDescription to handle migration in a cleaner way.
Signed-off-by: Vasilis Liaskovitis <address@hidden>
---
arch_init.c | 23 ++++++++++++++++++++---
1 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index a9e8b74..5f46b98 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -43,6 +43,7 @@
#include "hw/smbios.h"
#include "exec-memory.h"
#include "hw/pcspk.h"
+#include "hw/dimm.h"
#ifdef TARGET_SPARC
int graphic_width = 1024;
@@ -452,9 +453,25 @@ int ram_load(QEMUFile *f, void *opaque, int version_id)
}
if (!block) {
- fprintf(stderr, "Unknown ramblock \"%s\", cannot "
- "accept migration\n", id);
- return -EINVAL;
+ /* this can happen if a dimm was hot-added at source
host */
+ DimmState *slot = dimm_find_from_name(id);
+ if (slot) {
+ dimm_activate(slot);
+ /* rescan ram_list, verify ramblock is there now */
+ QLIST_FOREACH(block, &ram_list.blocks, next) {
+ if (!strncmp(id, block->idstr, sizeof(id))) {
+ if (block->length != length)
+ return -EINVAL;
+ break;
+ }
+ }
+ assert(block);
+ }
+ else {
+ fprintf(stderr, "Unknown ramblock \"%s\", cannot "
+ "accept migration\n", id);
+ return -EINVAL;
+ }
}
total_ram_bytes -= length;
--
1.7.9
- Re: [Qemu-devel] [RFC PATCH v2 04/21][SeaBIOS] acpi: generate hotplug memory devices, (continued)
- [Qemu-devel] [RFC PATCH v2 02/21][SeaBIOS] Add SSDT memory device support, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 14/21][SeaBIOS] acpi_dsdt: Support _OST dimm method, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 17/21][SeaBIOS] acpi_dsdt: Revert internal dimm state on _OST failure, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 06/21] dimm: Implement memory device abstraction, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 03/21][SeaBIOS] acpi-dsdt: Implement functions for memory hotplug, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 12/21] fix live-migration when "populated=on" is missing,
Vasilis Liaskovitis <=
- [Qemu-devel] [RFC PATCH v2 10/21] Implement "-dimm" command line option, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 09/21] pc: Add dimm paravirt SRAT info, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 11/21] Implement dimm_add and dimm_del hmp/qmp commands, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 07/21] acpi_piix4: Implement memory device hotplug registers, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 16/21] acpi_piix4: Update dimm state on VM reboot, Vasilis Liaskovitis, 2012/07/11
- [Qemu-devel] [RFC PATCH v2 13/21] Implement memory hotplug notification lists, Vasilis Liaskovitis, 2012/07/11