diff options
Diffstat (limited to 'buffered_file.c')
-rw-r--r-- | buffered_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/buffered_file.c b/buffered_file.c index 27627a1..1de47e0 100644 --- a/buffered_file.c +++ b/buffered_file.c @@ -65,9 +65,9 @@ static ssize_t buffered_flush(QEMUFileBuffered *s) DPRINTF("flushing %zu byte(s) of data\n", s->buffer_size); 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->migration_state, s->buffer + offset, - s->buffer_size - offset); + to_send); if (ret == -EAGAIN) { DPRINTF("backend not ready, freezing\n"); ret = 0; |