From 1a7824094556063bd1185b2459740394799eca2a Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 19 Oct 2011 23:47:49 +0200 Subject: [PATCH 14/19] savevm: Rename has_error to last_error field RH-Author: Juan Quintela Message-id: <0936083a58bfd76d670d8996b54a54aa4f829fd3.1319066771.git.quintela@redhat.com> Patchwork-id: 34440 O-Subject: [PATCH qemu-kvm RHEL-6.2 14/16] savevm: Rename has_error to last_error field Bugzilla: 669581 RH-Acked-by: Amit Shah RH-Acked-by: Orit Wasserman RH-Acked-by: Markus Armbruster Now the field contains the last error name, so rename acordingly. Signed-off-by: Juan Quintela Reviewed-by: Anthony Liguori --- savevm.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) Signed-off-by: Michal Novotny --- savevm.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/savevm.c b/savevm.c index be16a17..86d3279 100644 --- a/savevm.c +++ b/savevm.c @@ -173,7 +173,7 @@ struct QEMUFile { int buf_size; /* 0 when writing */ uint8_t buf[IO_BUF_SIZE]; - int has_error; + int last_error; }; typedef struct QEMUFileStdio @@ -427,12 +427,12 @@ QEMUFile *qemu_fopen_ops(void *opaque, QEMUFilePutBufferFunc *put_buffer, int qemu_file_get_error(QEMUFile *f) { - return f->has_error; + return f->last_error; } void qemu_file_set_error(QEMUFile *f, int ret) { - f->has_error = ret; + f->last_error = ret; } void qemu_fflush(QEMUFile *f) @@ -447,7 +447,7 @@ void qemu_fflush(QEMUFile *f) if (len > 0) f->buf_offset += f->buf_index; else - f->has_error = -EINVAL; + f->last_error = -EINVAL; f->buf_index = 0; } } @@ -476,7 +476,7 @@ static void qemu_fill_buffer(QEMUFile *f) f->buf_size += len; f->buf_offset += len; } else if (len != -EAGAIN) - f->has_error = len; + f->last_error = len; } int qemu_fclose(QEMUFile *f) @@ -498,13 +498,13 @@ void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size) { int l; - if (!f->has_error && f->is_write == 0 && f->buf_index > 0) { + if (!f->last_error && f->is_write == 0 && f->buf_index > 0) { fprintf(stderr, "Attempted to write to buffer while read buffer is not empty\n"); abort(); } - while (!f->has_error && size > 0) { + while (!f->last_error && size > 0) { l = IO_BUF_SIZE - f->buf_index; if (l > size) l = size; @@ -520,7 +520,7 @@ void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size) void qemu_put_byte(QEMUFile *f, int v) { - if (!f->has_error && f->is_write == 0 && f->buf_index > 0) { + if (!f->last_error && f->is_write == 0 && f->buf_index > 0) { fprintf(stderr, "Attempted to write to buffer while read buffer is not empty\n"); abort(); -- 1.7.4.4