Now that we have error handling we can do proper handling of
buffered_flush().

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

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

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;
         }

-- 
1.8.1


Reply via email to