From afe419319de1e5e98b131368ba14f85f98ab3a76 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Mon, 14 Jan 2013 13:36:28 +0100 Subject: qemu-file: Only set last_error if it is not already set Signed-off-by: Juan Quintela Reviewed-by: Reviewed-by: Eric Blake Reviewed-by: Paolo Bonzini --- savevm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'savevm.c') 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 -- cgit v1.2.3