qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]