qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 08/18] savevm: add error parameter to qemu_savevm_st


From: Pavel Hrdina
Subject: [Qemu-devel] [PATCH 08/18] savevm: add error parameter to qemu_savevm_state_begin()
Date: Wed, 15 Aug 2012 09:41:49 +0200

Signed-off-by: Pavel Hrdina <address@hidden>
---
 migration.c | 2 +-
 savevm.c    | 7 +++++--
 sysemu.h    | 3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/migration.c b/migration.c
index 653a3c1..dde4dec 100644
--- a/migration.c
+++ b/migration.c
@@ -429,7 +429,7 @@ void migrate_fd_connect(MigrationState *s)
                                       migrate_fd_close);
 
     DPRINTF("beginning savevm\n");
-    ret = qemu_savevm_state_begin(s->file, &s->params);
+    ret = qemu_savevm_state_begin(s->file, &s->params, NULL);
     if (ret < 0) {
         DPRINTF("failed, %d\n", ret);
         migrate_fd_error(s);
diff --git a/savevm.c b/savevm.c
index 0d14f71..d212cb2 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1555,7 +1555,8 @@ bool qemu_savevm_state_blocked(Error **errp)
 }
 
 int qemu_savevm_state_begin(QEMUFile *f,
-                            const MigrationParams *params)
+                            const MigrationParams *params,
+                            Error **errp)
 {
     SaveStateEntry *se;
     int ret;
@@ -1595,12 +1596,14 @@ int qemu_savevm_state_begin(QEMUFile *f,
 
         ret = se->ops->save_live_setup(f, se->opaque);
         if (ret < 0) {
+            error_set(errp, QERR_GENERIC_ERROR, ret);
             qemu_savevm_state_cancel(f);
             return ret;
         }
     }
     ret = qemu_file_get_error(f);
     if (ret != 0) {
+        error_set(errp, QERR_GENERIC_ERROR, ret);
         qemu_savevm_state_cancel(f);
     }
 
@@ -1737,7 +1740,7 @@ static int qemu_savevm_state(QEMUFile *f)
         goto out;
     }
 
-    ret = qemu_savevm_state_begin(f, &params);
+    ret = qemu_savevm_state_begin(f, &params, NULL);
     if (ret < 0)
         goto out;
 
diff --git a/sysemu.h b/sysemu.h
index 4669348..bc65c64 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -78,7 +78,8 @@ void qemu_announce_self(void);
 
 bool qemu_savevm_state_blocked(Error **errp);
 int qemu_savevm_state_begin(QEMUFile *f,
-                            const MigrationParams *params);
+                            const MigrationParams *params,
+                            Error **errp);
 int qemu_savevm_state_iterate(QEMUFile *f);
 int qemu_savevm_state_complete(QEMUFile *f);
 void qemu_savevm_state_cancel(QEMUFile *f);
-- 
1.7.11.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]