Skip to content

Commit

Permalink
arch_init/ram_load: add error message for block length mismatch
Browse files Browse the repository at this point in the history
Makes it easier to debug situations where the source and target have
different ram blocks in a device and migration fails due to that, for
instance a BAR size change on a PCI device.

Signed-off-by: Alon Levy <[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
  • Loading branch information
Alon Levy authored and Juan Quintela committed Jun 27, 2013
1 parent 3e50873 commit 87d2f82
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,9 @@ 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->length != length) {
fprintf(stderr, "Length mismatch: %s: %ld "
"in != " RAM_ADDR_FMT "\n", id, length,
block->length);
ret = -EINVAL;
goto done;
}
Expand Down

0 comments on commit 87d2f82

Please sign in to comment.