[RFC,01/11] savevm: use qemu_file_set_error() instead of setting last_error directly
diff mbox

Message ID 1320175230-27980-2-git-send-email-ehabkost@redhat.com
State New
Headers show

Commit Message

Eduardo Habkost Nov. 1, 2011, 7:20 p.m. UTC
Some code uses qemu_file_set_error() already, so use it everywhere
when setting last_error, for consistency.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 savevm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox

diff --git a/savevm.c b/savevm.c
index f01838f..dc3311b 100644
--- a/savevm.c
+++ b/savevm.c
@@ -448,7 +448,7 @@  void qemu_fflush(QEMUFile *f)
         if (len > 0)
             f->buf_offset += f->buf_index;
         else
-            f->last_error = -EINVAL;
+            qemu_file_set_error(f, -EINVAL);
         f->buf_index = 0;
     }
 }
@@ -477,7 +477,7 @@  static void qemu_fill_buffer(QEMUFile *f)
         f->buf_size += len;
         f->buf_offset += len;
     } else if (len != -EAGAIN)
-        f->last_error = len;
+        qemu_file_set_error(f, len);
 }
 
 int qemu_fclose(QEMUFile *f)