On 27/04/2015 07:40, Fam Zheng wrote:
> +
> + if (!qiov) {
Perhaps "if (!qiov && bytes >= align)"?
Paolo
> + uint64_t aligned_bytes = bytes & ~(align - 1);
> +
> + assert((offset & (align - 1)) == 0);
> + ret = bdrv_aligned_pwritev(bs, &req, offset, aligned_bytes,
> + NULL, flags);
> + if (ret < 0) {
> + goto fail;
> + }
> + bytes -= aligned_bytes;
> + offset += aligned_bytes;
> }
