f->iov[f->iovcnt++].iov_len = size;
}
- if (f->buf_index >= IO_BUF_SIZE || f->iovcnt >= MAX_IOV_SIZE) {
+ if (f->iovcnt >= MAX_IOV_SIZE) {
qemu_fflush(f);
}
}
f->bytes_xfer += size;
if (f->ops->writev_buffer) {
add_to_iovec(f, f->buf + f->buf_index, l);
- f->buf_index += l;
- } else {
- f->buf_index += l;
- if (f->buf_index == IO_BUF_SIZE) {
- qemu_fflush(f);
- }
+ }
+ f->buf_index += l;
+ if (f->buf_index == IO_BUF_SIZE) {
+ qemu_fflush(f);
}
if (qemu_file_get_error(f)) {
break;
f->bytes_xfer++;
if (f->ops->writev_buffer) {
add_to_iovec(f, f->buf + f->buf_index, 1);
- f->buf_index++;
- } else {
- f->buf_index++;
- if (f->buf_index == IO_BUF_SIZE) {
- qemu_fflush(f);
- }
+ }
+ f->buf_index++;
+ if (f->buf_index == IO_BUF_SIZE) {
+ qemu_fflush(f);
}
}