2013-05-25 18:38:28 +00:00
|
|
|
From 015c261bdbb06a737b14600d62c37fef28ea9d22 Mon Sep 17 00:00:00 2001
|
2013-05-23 01:48:57 +00:00
|
|
|
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Date: Fri, 22 Feb 2013 17:36:15 +0100
|
2013-05-25 18:38:28 +00:00
|
|
|
Subject: [PATCH] migration: flush all data to fd when buffered_flush is called
|
2013-05-23 01:48:57 +00:00
|
|
|
|
|
|
|
Including data that resided in the QEMUFile's own buffer.
|
|
|
|
|
|
|
|
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
|
|
|
|
Reviewed-by: Juan Quintela <quintela@redhat.com>
|
|
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
2013-05-25 18:38:28 +00:00
|
|
|
(cherry picked from commit f5821518ed6d49aae9fd0aa6169d2d74bb83054c)
|
2013-05-23 01:48:57 +00:00
|
|
|
---
|
|
|
|
migration.c | 2 ++
|
|
|
|
1 file changed, 2 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/migration.c b/migration.c
|
|
|
|
index 739e38c..1027b40 100644
|
|
|
|
--- a/migration.c
|
|
|
|
+++ b/migration.c
|
|
|
|
@@ -525,6 +525,8 @@ static ssize_t buffered_flush(MigrationState *s)
|
|
|
|
|
|
|
|
DPRINTF("flushing %zu byte(s) of data\n", s->buffer_size);
|
|
|
|
|
|
|
|
+ qemu_fflush(s->file);
|
|
|
|
+
|
|
|
|
while (s->bytes_xfer < s->xfer_limit && offset < s->buffer_size) {
|
|
|
|
size_t to_send = MIN(s->buffer_size - offset, s->xfer_limit - s->bytes_xfer);
|
|
|
|
ret = migrate_fd_put_buffer(s, s->buffer + offset, to_send);
|