Patchwork [v3,10/11] savevm: update return value from qemu_savevm_state

login
register
mail settings
Submitter Pavel Hrdina
Date March 28, 2013, 4:47 p.m.
Message ID <1b1a586c1dc57585d6568a0bcb97b2ba1b11b641.1364487348.git.phrdina@redhat.com>
Download mbox | patch
Permalink /patch/232134/
State New
Headers show

Comments

Pavel Hrdina - March 28, 2013, 4:47 p.m.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 savevm.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
Eric Blake - March 28, 2013, 10 p.m.
On 03/28/2013 10:47 AM, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
>  savevm.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

Patch

diff --git a/savevm.c b/savevm.c
index 0dce456..1e9ab4b 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1910,7 +1910,7 @@  void qemu_savevm_state_cancel(void)
     }
 }
 
-static int qemu_savevm_state(QEMUFile *f, Error **errp)
+static void qemu_savevm_state(QEMUFile *f, Error **errp)
 {
     int ret;
     MigrationParams params = {
@@ -1919,7 +1919,7 @@  static int qemu_savevm_state(QEMUFile *f, Error **errp)
     };
 
     if (qemu_savevm_state_blocked(errp)) {
-        return -EINVAL;
+        return;
     }
 
     qemu_mutex_unlock_iothread();
@@ -1940,7 +1940,6 @@  static int qemu_savevm_state(QEMUFile *f, Error **errp)
     if (ret != 0) {
         qemu_savevm_state_cancel();
     }
-    return ret;
 }
 
 static int qemu_save_device_state(QEMUFile *f)
@@ -2327,10 +2326,10 @@  SnapshotInfo *qmp_vm_snapshot_save(bool has_name, const char *name,
         error_setg(errp, "Failed to open '%s' file.", bdrv_get_device_name(bs));
         goto the_end;
     }
-    ret = qemu_savevm_state(f, &local_err);
+    qemu_savevm_state(f, &local_err);
     vm_state_size = qemu_ftell(f);
     qemu_fclose(f);
-    if (ret < 0) {
+    if (error_is_set(&local_err)) {
         error_propagate(errp, local_err);
         goto the_end;
     }