diff options
author | Wei Yang | 2019-09-11 15:28:39 +0200 |
---|---|---|
committer | Dr. David Alan Gilbert | 2019-09-12 12:23:32 +0200 |
commit | 1bf57fb3df9615b50219c50b381cc52e303f682c (patch) | |
tree | ac3d66c60d945acf42e15580f70fdcae5f750b2d /linux-user/syscall_defs.h | |
parent | migration/qemu-file: remove check on writev_buffer in qemu_put_compression_data (diff) | |
download | qemu-1bf57fb3df9615b50219c50b381cc52e303f682c.tar.gz qemu-1bf57fb3df9615b50219c50b381cc52e303f682c.tar.xz qemu-1bf57fb3df9615b50219c50b381cc52e303f682c.zip |
migration/qemu-file: fix potential buf waste for extra buf_index adjustment
In add_to_iovec(), qemu_fflush() will be called if iovec is full. If
this happens, buf_index is reset. Currently, this is not checked and
buf_index would always been adjust with buf size.
This is not harmful, but will waste some space in file buffer.
This patch make add_to_iovec() return 1 when it has flushed the file.
Then the caller could check the return value to see whether it is
necessary to adjust the buf_index any more.
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190911132839.23336-3-richard.weiyang@gmail.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'linux-user/syscall_defs.h')
0 files changed, 0 insertions, 0 deletions