[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 6/8] arch_init: support resizing on incoming migr
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PATCH v2 6/8] arch_init: support resizing on incoming migration |
Date: |
Tue, 16 Dec 2014 18:15:15 +0200 |
If block used_length does not match, try to resize it.
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
arch_init.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 106f46e..cfedbf0 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -1086,11 +1086,14 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
if (!strncmp(id, block->idstr, sizeof(id))) {
- if (block->used_length != length) {
- error_report("Length mismatch: %s: 0x" RAM_ADDR_FMT
- " in != 0x" RAM_ADDR_FMT, id, length,
- block->used_length);
- ret = -EINVAL;
+ if (length != block->used_length) {
+ Error *local_err = NULL;
+
+ ret = qemu_ram_resize(block->offset, length,
&local_err);
+ if (local_err) {
+ error_report("%s",
error_get_pretty(local_err));
+ error_free(local_err);
+ }
}
break;
}
--
MST
- [Qemu-devel] [PATCH v2 0/8] acpi: make ROMs resizeable, Michael S. Tsirkin, 2014/12/16
- [Qemu-devel] [PATCH v2 1/8] cpu: add cpu_physical_memory_clear_dirty_range_nocode, Michael S. Tsirkin, 2014/12/16
- [Qemu-devel] [PATCH v2 2/8] memory: add memory_region_set_size, Michael S. Tsirkin, 2014/12/16
- [Qemu-devel] [PATCH v2 3/8] exec: cpu_physical_memory_set/clear_dirty_range, Michael S. Tsirkin, 2014/12/16
- [Qemu-devel] [PATCH v2 4/8] exec: split length -> used_length/max_length, Michael S. Tsirkin, 2014/12/16
- [Qemu-devel] [PATCH v2 5/8] exec: qemu_ram_alloc_resizeable, qemu_ram_resize, Michael S. Tsirkin, 2014/12/16
- [Qemu-devel] [PATCH v2 6/8] arch_init: support resizing on incoming migration,
Michael S. Tsirkin <=
- [Qemu-devel] [PATCH v2 7/8] memory: API to allocate resizeable RAM MR, Michael S. Tsirkin, 2014/12/16
- [Qemu-devel] [PATCH v2 8/8] acpi-build: make ROMs RAM blocks resizeable, Michael S. Tsirkin, 2014/12/16
- Re: [Qemu-devel] [PATCH v2 0/8] acpi: make ROMs resizeable, Dr. David Alan Gilbert, 2014/12/18