Patchwork [11/18] savevm: add error parameter to qemu_savevm_state()

login
register
mail settings
Submitter Pavel Hrdina
Date Aug. 15, 2012, 7:41 a.m.
Message ID <f39777f9bd79b71ac7a3cff9e9bec694ac536760.1345016001.git.phrdina@redhat.com>
Download mbox | patch
Permalink /patch/177571/
State New
Headers show

Comments

Pavel Hrdina - Aug. 15, 2012, 7:41 a.m.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 savevm.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

Patch

diff --git a/savevm.c b/savevm.c
index 0f7d681..0d54115 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1741,7 +1741,8 @@  void qemu_savevm_state_cancel(QEMUFile *f)
     }
 }
 
-static int qemu_savevm_state(QEMUFile *f)
+static int qemu_savevm_state(QEMUFile *f,
+                             Error **errp)
 {
     int ret;
     MigrationParams params = {
@@ -1749,22 +1750,24 @@  static int qemu_savevm_state(QEMUFile *f)
         .shared = 0
     };
 
-    if (qemu_savevm_state_blocked(NULL)) {
+    if (qemu_savevm_state_blocked(errp)) {
         ret = -EINVAL;
         goto out;
     }
 
-    ret = qemu_savevm_state_begin(f, &params, NULL);
-    if (ret < 0)
+    ret = qemu_savevm_state_begin(f, &params, errp);
+    if (ret < 0) {
         goto out;
+    }
 
     do {
-        ret = qemu_savevm_state_iterate(f, NULL);
-        if (ret < 0)
+        ret = qemu_savevm_state_iterate(f, errp);
+        if (ret < 0) {
             goto out;
+        }
     } while (ret == 0);
 
-    ret = qemu_savevm_state_complete(f, NULL);
+    ret = qemu_savevm_state_complete(f, errp);
 
 out:
     if (ret == 0) {
@@ -2171,7 +2174,7 @@  void do_savevm(Monitor *mon, const QDict *qdict)
         monitor_printf(mon, "Could not open VM state file\n");
         goto the_end;
     }
-    ret = qemu_savevm_state(f);
+    ret = qemu_savevm_state(f, NULL);
     vm_state_size = qemu_ftell(f);
     qemu_fclose(f);
     if (ret < 0) {