From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Amit Shah <amit.shah@redhat.com>,
pbonzini@redhat.com, imammedo@redhat.com, dgilbert@redhat.com,
Juan Quintela <quintela@redhat.com>
Subject: [Qemu-devel] [PATCH v2 6/8] arch_init: support resizing on incoming migration
Date: Tue, 16 Dec 2014 18:15:15 +0200 [thread overview]
Message-ID: <1418746479-21634-7-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1418746479-21634-1-git-send-email-mst@redhat.com>
If block used_length does not match, try to resize it.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
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
next prev parent reply other threads:[~2014-12-16 16:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-16 16:14 [Qemu-devel] [PATCH v2 0/8] acpi: make ROMs resizeable Michael S. Tsirkin
2014-12-16 16:14 ` [Qemu-devel] [PATCH v2 1/8] cpu: add cpu_physical_memory_clear_dirty_range_nocode Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 2/8] memory: add memory_region_set_size Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 3/8] exec: cpu_physical_memory_set/clear_dirty_range Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 4/8] exec: split length -> used_length/max_length Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 5/8] exec: qemu_ram_alloc_resizeable, qemu_ram_resize Michael S. Tsirkin
2014-12-16 16:15 ` Michael S. Tsirkin [this message]
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 7/8] memory: API to allocate resizeable RAM MR Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 8/8] acpi-build: make ROMs RAM blocks resizeable Michael S. Tsirkin
2014-12-18 18:49 ` [Qemu-devel] [PATCH v2 0/8] acpi: make ROMs resizeable Dr. David Alan Gilbert
2014-12-18 19:43 ` Michael S. Tsirkin
2014-12-18 20:16 ` Dr. David Alan Gilbert
2014-12-18 21:49 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1418746479-21634-7-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=amit.shah@redhat.com \
--cc=dgilbert@redhat.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).