OSDN Git Service

buffered_file: don't flush on put buffer
authorJuan Quintela <quintela@redhat.com>
Tue, 24 Jul 2012 12:00:13 +0000 (14:00 +0200)
committerJuan Quintela <quintela@redhat.com>
Thu, 20 Dec 2012 22:09:25 +0000 (23:09 +0100)
We call buffered_put_buffer with iothread held, and buffered_flush() does
synchronous writes.  We only want to do the synchronous writes outside.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
buffered_file.c

index d61d805..1d7fa24 100644 (file)
@@ -106,12 +106,6 @@ static int buffered_put_buffer(void *opaque, const uint8_t *buf, int64_t pos, in
         buffered_append(s, buf, size);
     }
 
-    error = buffered_flush(s);
-    if (error < 0) {
-        DPRINTF("buffered flush error. bailing: %s\n", strerror(-error));
-        return error;
-    }
-
     return size;
 }