aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/savevm.c b/savevm.c
index a8a53efc9b..4302903e7c 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1621,17 +1621,11 @@ int qemu_savevm_state_begin(QEMUFile *f,
ret = se->ops->save_live_setup(f, se->opaque);
if (ret < 0) {
- qemu_savevm_state_cancel();
return ret;
}
}
ret = qemu_file_get_error(f);
- if (ret != 0) {
- qemu_savevm_state_cancel();
- }
-
return ret;
-
}
/*
@@ -1677,9 +1671,6 @@ int qemu_savevm_state_iterate(QEMUFile *f)
return ret;
}
ret = qemu_file_get_error(f);
- if (ret != 0) {
- qemu_savevm_state_cancel();
- }
return ret;
}
@@ -1778,8 +1769,7 @@ static int qemu_savevm_state(QEMUFile *f)
};
if (qemu_savevm_state_blocked(NULL)) {
- ret = -EINVAL;
- goto out;
+ return -EINVAL;
}
ret = qemu_savevm_state_begin(f, &params);
@@ -1798,6 +1788,9 @@ out:
if (ret == 0) {
ret = qemu_file_get_error(f);
}
+ if (ret != 0) {
+ qemu_savevm_state_cancel();
+ }
return ret;
}