aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2011-10-05 01:05:21 +0200
committerJuan Quintela <quintela@redhat.com>2011-10-20 13:23:52 +0200
commit3961b4dd0e72ae70e612be1097176d8910fc3f5e (patch)
tree37129248c2216bb063ba4b6b2e4b588a4918cc84 /savevm.c
parent624b9cc20922fe7b046cd79c839d1f3a5a5fc27e (diff)
savevm: Rename has_error to last_error field
Now the field contains the last error name, so rename acordingly. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/savevm.c b/savevm.c
index 819a6f791e..89147a6906 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();