[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V2 1/2] migration/qemu-file: remove check on writev_
From: |
Wei Yang |
Subject: |
[Qemu-devel] [PATCH V2 1/2] migration/qemu-file: remove check on writev_buffer in qemu_put_compression_data |
Date: |
Wed, 11 Sep 2019 13:28:38 +0000 |
From: Wei Yang <address@hidden>
The check of writev_buffer is in qemu_fflush, which means it is not
harmful if it is NULL.
And removing it will make the code consistent since all other
add_to_iovec() is called without the check.
Signed-off-by: Wei Yang <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
---
migration/qemu-file.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index e33c46764f..47f16d0e54 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -761,9 +761,7 @@ ssize_t qemu_put_compression_data(QEMUFile *f, z_stream
*stream,
}
qemu_put_be32(f, blen);
- if (f->ops->writev_buffer) {
- add_to_iovec(f, f->buf + f->buf_index, blen, false);
- }
+ add_to_iovec(f, f->buf + f->buf_index, blen, false);
f->buf_index += blen;
if (f->buf_index == IO_BUF_SIZE) {
qemu_fflush(f);
--
2.15.1