aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-08-20 19:42:23 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:30:21 -0500
commitb5a22e4a0aaead2ceeb5af445c9d460d910601cf (patch)
tree6d438a944b1a80c55305a2f528fc58f3266f6b39
parent05f2401eb25fd35b073ca925a9c3929eddb12ec8 (diff)
Use return value from load_state() call back
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--savevm.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/savevm.c b/savevm.c
index f273cb98bd..ab7c0d328a 100644
--- a/savevm.c
+++ b/savevm.c
@@ -984,7 +984,12 @@ int qemu_loadvm_state(QEMUFile *f)
le->next = first_le;
first_le = le;
- le->se->load_state(f, le->se->opaque, le->version_id);
+ ret = le->se->load_state(f, le->se->opaque, le->version_id);
+ if (ret < 0) {
+ fprintf(stderr, "qemu: warning: error while loading state for instance 0x%x of device '%s'\n",
+ instance_id, idstr);
+ goto out;
+ }
break;
case QEMU_VM_SECTION_PART:
case QEMU_VM_SECTION_END:
@@ -997,7 +1002,12 @@ int qemu_loadvm_state(QEMUFile *f)
goto out;
}
- le->se->load_state(f, le->se->opaque, le->version_id);
+ ret = le->se->load_state(f, le->se->opaque, le->version_id);
+ if (ret < 0) {
+ fprintf(stderr, "qemu: warning: error while loading state section id %d\n",
+ section_id);
+ goto out;
+ }
break;
default:
fprintf(stderr, "Unknown savevm section type %d\n", section_type);