When a write request spans both allocated and unallocated clusters, qcow2 splits the request in two parts. This is not necessary if we have sequential writes: If the unallocated area can be allocated such that in the image file it is adjacent to the already allocated part, a single request is enough.
Kevin Wolf (3): qcow2: Factor out count_cow_clusters qcow2: Add qcow2_alloc_clusters_at() qcow2: Reduce number of I/O requests block/qcow2-cluster.c | 274 +++++++++++++++++++++++++++++++++--------------- block/qcow2-refcount.c | 28 +++++ block/qcow2.h | 3 + trace-events | 1 + 4 files changed, 222 insertions(+), 84 deletions(-) -- 1.7.6.5