arch_init: support resizing on incoming migration
If block used_length does not match, try to resize it. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
62be4e3a50
commit
b0cc3f8397
13
arch_init.c
13
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) {
|
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
|
||||||
if (!strncmp(id, block->idstr, sizeof(id))) {
|
if (!strncmp(id, block->idstr, sizeof(id))) {
|
||||||
if (block->used_length != length) {
|
if (length != block->used_length) {
|
||||||
error_report("Length mismatch: %s: 0x" RAM_ADDR_FMT
|
Error *local_err = NULL;
|
||||||
" in != 0x" RAM_ADDR_FMT, id, length,
|
|
||||||
block->used_length);
|
ret = qemu_ram_resize(block->offset, length, &local_err);
|
||||||
ret = -EINVAL;
|
if (local_err) {
|
||||||
|
error_report("%s", error_get_pretty(local_err));
|
||||||
|
error_free(local_err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user