diff options
author | Juan Quintela <quintela@redhat.com> | 2011-09-21 23:01:54 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2011-10-20 13:23:52 +0200 |
commit | dcd1d224dfcad1154a516e683ab55ea848497f50 (patch) | |
tree | 41ff40193382ba0ad72dba2116a43c359935ce8e /savevm.c | |
parent | af509450816d17b4cbfff673be21b830f05018fc (diff) |
migration: change has_error to contain errno values
We normally already have an errno value. When not, abuse EIO.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'savevm.c')
-rw-r--r-- | savevm.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -430,9 +430,9 @@ int qemu_file_has_error(QEMUFile *f) return f->has_error; } -void qemu_file_set_error(QEMUFile *f) +void qemu_file_set_error(QEMUFile *f, int ret) { - f->has_error = 1; + f->has_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 = 1; + f->has_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 = 1; + f->has_error = len; } int qemu_fclose(QEMUFile *f) |