diff mbox

[v3] arch_init/ram_load: add error message for block length mismatch

Message ID 1368357388-25906-1-git-send-email-alevy@redhat.com
State New
Headers show

Commit Message

Alon Levy May 12, 2013, 11:16 a.m. UTC
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 <alevy@redhat.com>
---
v3: use RAM_ADDR_FMT

 arch_init.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Juan Quintela May 13, 2013, 8:57 a.m. UTC | #1
Alon Levy <alevy@redhat.com> wrote:
> 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 <alevy@redhat.com>
> ---
> v3: use RAM_ADDR_FMT
>
>  arch_init.c | 3 +++
>  1 file changed, 3 insertions(+)
>

Reviewed-by: Juan Quintela <quintela@redhat.com>

will be included in next pull request. thanks.

> diff --git a/arch_init.c b/arch_init.c
> index 49c5dc2..cd27fcf 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -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;
>                              }
diff mbox

Patch

diff --git a/arch_init.c b/arch_init.c
index 49c5dc2..cd27fcf 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -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;
                             }