[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 08/12] Use writev ops instead of put_buffer ops
From: |
Orit Wasserman |
Subject: |
[Qemu-devel] [RFC 08/12] Use writev ops instead of put_buffer ops |
Date: |
Thu, 21 Mar 2013 11:09:27 +0200 |
Update qemu_fflush and stdio_close to use writev ops
Signed-off-by: Orit Wasserman <address@hidden>
---
savevm.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/savevm.c b/savevm.c
index d5834ca..9506a20 100644
--- a/savevm.c
+++ b/savevm.c
@@ -297,7 +297,7 @@ static int stdio_fclose(void *opaque)
QEMUFileStdio *s = opaque;
int ret = 0;
- if (s->file->ops->put_buffer) {
+ if (s->file->ops->writev_buffer) {
int fd = fileno(s->stdio_file);
struct stat st;
@@ -534,18 +534,19 @@ static void qemu_file_set_error(QEMUFile *f, int ret)
}
}
-/** Flushes QEMUFile buffer
+/**
+ * Flushes QEMUFile iovec
*
*/
static void qemu_fflush(QEMUFile *f)
{
int ret = 0;
- if (!f->ops->put_buffer) {
+ if (!f->ops->writev_buffer) {
return;
}
- if (f->is_write && f->buf_index > 0) {
- ret = f->ops->put_buffer(f->opaque, f->buf, f->pos, f->buf_index);
+ if (f->is_write && f->iovcnt > 0) {
+ ret = f->ops->writev_buffer(f->opaque, f->iov, f->iovcnt);
if (ret >= 0) {
f->pos += f->buf_index;
}
--
1.7.11.7
- [Qemu-devel] [RFC 04/12] Add stdio_writev_buffer function, (continued)
[Qemu-devel] [RFC 08/12] Use writev ops instead of put_buffer ops,
Orit Wasserman <=
[Qemu-devel] [RFC 09/12] More optimized qemu_put_be64/32/16, Orit Wasserman, 2013/03/21
[Qemu-devel] [RFC 10/12] Add qemu_put_buffer_no_copy, Orit Wasserman, 2013/03/21
[Qemu-devel] [RFC 11/12] Use qemu_put_buffer_no_copy for guest memory pages, Orit Wasserman, 2013/03/21
[Qemu-devel] [RFC 12/12] Bye Bye put_buffer, Orit Wasserman, 2013/03/21