Signed-off-by: Pavel Hrdina <phrd...@redhat.com> --- savevm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/savevm.c b/savevm.c index f9858cc..a7254b2 100644 --- a/savevm.c +++ b/savevm.c @@ -1768,8 +1768,8 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp) .shared = 0 }; - if (qemu_savevm_state_blocked(errp)) { - ret = -EINVAL; + ret = qemu_savevm_state_blocked(errp); + if (ret) { goto out; } @@ -1793,7 +1793,7 @@ out: } } - return ret; + return ret == 0 ? 0 : -1; } static int qemu_save_device_state(QEMUFile *f) @@ -2189,6 +2189,7 @@ void qmp_vm_snapshot_save(bool has_name, const char *name, Error **errp) error_setg(errp, "Failed to open '%s' file.", bdrv_get_device_name(bs)); goto the_end; } + ret = qemu_savevm_state(f, &local_err); vm_state_size = qemu_ftell(f); qemu_fclose(f); -- 1.8.1