Patchwork [07/13] qemu-file: Only set last_error if it is not already set

login
register
mail settings
Submitter Juan Quintela
Date Jan. 17, 2013, 1:39 p.m.
Message ID <1358429973-9321-8-git-send-email-quintela@redhat.com>
Download mbox | patch
Permalink /patch/213267/
State New
Headers show

Comments

Juan Quintela - Jan. 17, 2013, 1:39 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
 savevm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch

diff --git a/savevm.c b/savevm.c
index 4e970ca..611e997 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