]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration/qemu-file: remove check on writev_buffer in qemu_put_compression_data
authorWei Yang <richardw.yang@linux.intel.com>
Wed, 11 Sep 2019 13:28:38 +0000 (13:28 +0000)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 12 Sep 2019 10:23:26 +0000 (11:23 +0100)
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 <richardw.yang@linux.intel.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190911132839.23336-2-richard.weiyang@gmail.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/qemu-file.c

index 075faf03c36fab78fa21832250df0556be35ee39..66627088d4fbbcbe5b437b5ae7f318a346842394 100644 (file)
@@ -760,9 +760,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);