aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2011-09-21 23:01:54 +0200
committerJuan Quintela <quintela@redhat.com>2011-10-20 13:23:52 +0200
commitdcd1d224dfcad1154a516e683ab55ea848497f50 (patch)
tree41ff40193382ba0ad72dba2116a43c359935ce8e /savevm.c
parentaf509450816d17b4cbfff673be21b830f05018fc (diff)
downloadqemu-dcd1d224dfcad1154a516e683ab55ea848497f50.zip
qemu-dcd1d224dfcad1154a516e683ab55ea848497f50.tar.gz
qemu-dcd1d224dfcad1154a516e683ab55ea848497f50.tar.bz2
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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/savevm.c b/savevm.c
index ca9e233..5bef618 100644
--- a/savevm.c
+++ b/savevm.c
@@ -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)