aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2013-01-14 13:36:28 +0100
committerJuan Quintela <quintela@redhat.com>2013-01-17 13:54:16 +0100
commitafe419319de1e5e98b131368ba14f85f98ab3a76 (patch)
tree2a826581351f961ec5e3ac90c0cd3644bbfcfd47
parent1e973051b96bac5eef46393eec15b68796e7c7d3 (diff)
qemu-file: Only set last_error if it is not already set
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--savevm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/savevm.c b/savevm.c
index 4e970ca0db..611e997d42 100644
--- a/savevm.c
+++ b/savevm.c
@@ -419,7 +419,9 @@ int qemu_file_get_error(QEMUFile *f)
static void qemu_file_set_error(QEMUFile *f, int ret)
{
- f->last_error = ret;
+ if (f->last_error == 0) {
+ f->last_error = ret;
+ }
}
/** Flushes QEMUFile buffer