diff mbox

[PULL,4/4] migration: add error_report

Message ID 1483633930-7103-5-git-send-email-amit.shah@redhat.com
State New
Headers show

Commit Message

Amit Shah Jan. 5, 2017, 4:32 p.m. UTC
From: Jianjun Duan <duanj@linux.vnet.ibm.com>

Added error_report where version_ids do not match in vmstate_load_state.

Signed-off-by: Jianjun Duan <duanj@linux.vnet.ibm.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: 1481224870-18247-5-git-send-email-duanj@linux.vnet.ibm.com
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 migration/vmstate.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/migration/vmstate.c b/migration/vmstate.c
index 2f9d4ba..8ddd230 100644
--- a/migration/vmstate.c
+++ b/migration/vmstate.c
@@ -85,6 +85,9 @@  int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
 
     trace_vmstate_load_state(vmsd->name, version_id);
     if (version_id > vmsd->version_id) {
+        error_report("%s: incoming version_id %d is too new "
+                     "for local version_id %d",
+                     vmsd->name, version_id, vmsd->version_id);
         trace_vmstate_load_state_end(vmsd->name, "too new", -EINVAL);
         return -EINVAL;
     }
@@ -95,6 +98,9 @@  int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
             trace_vmstate_load_state_end(vmsd->name, "old path", ret);
             return ret;
         }
+        error_report("%s: incoming version_id %d is too old "
+                     "for local minimum version_id  %d",
+                     vmsd->name, version_id, vmsd->minimum_version_id);
         trace_vmstate_load_state_end(vmsd->name, "too old", -EINVAL);
         return -EINVAL;
     }