Signed-off-by: Pavel Hrdina <phrd...@redhat.com> --- savevm.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
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; } -- 1.8.1.4