diff mbox

[05/23] Use return value from load_state() call back

Message ID 1625967157e355a3312b64265b026fdce7087cb2.1250788880.git.quintela@redhat.com
State Superseded
Headers show

Commit Message

Juan Quintela Aug. 20, 2009, 5:42 p.m. UTC
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 savevm.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/savevm.c b/savevm.c
index 4868285..ffa68da 100644
--- a/savevm.c
+++ b/savevm.c
@@ -955,7 +955,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:
@@ -968,7 +973,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);