Patchwork [09/13] migration: Add buffered_flush error handling

login
register
mail settings
Submitter Juan Quintela
Date Jan. 17, 2013, 1:39 p.m.
Message ID <1358429973-9321-10-git-send-email-quintela@redhat.com>
Download mbox | patch
Permalink /patch/213293/
State New
Headers show

Comments

Juan Quintela - Jan. 17, 2013, 1:39 p.m.
Now that we have error handling we can do proper handling of
buffered_flush().

Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
 migration.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/migration.c b/migration.c
index 7ae1d93..17eb27d 100644
--- a/migration.c
+++ b/migration.c
@@ -757,7 +757,8 @@  static void *buffered_file_thread(void *opaque)
             /* usleep expects microseconds */
             g_usleep((initial_time + BUFFER_DELAY - current_time)*1000);
         }
-        if (buffered_flush(s) < 0) {
+        ret = buffered_flush(s);
+        if (ret < 0) {
             break;
         }