Increase default qcow cluster size to 4KB
PATCH 1/1 Increase default qcow cluster size to 4KB
Regards,
Anthony Liguori
# HG changeset patch
# User Anthony Liguori <[email protected]>
# Node ID 76bb5704c9afe3fb930e81e13fd6de57b452ff5c
# Parent 4fcb5f2d8d8646e56ddb2f6bac4d457b66fdb8ab
Change default cluster size for qcow disks to 4KB. This size makes it much easier for implementing high-performance qcow backends (for things like Xen) as the kernel tends to like to deal with reads/writes in at least 4K chunks.
block-qcow.c +4 -7
@@ -574,13 +574,10 @@ static int qcow_create(const char *filen }else backing_file =NULL ; header.mtime =cpu_to_be32 (st.st_mtime); - header.cluster_bits =9 ;/* 512 byte cluster to avoid copying -unmodifyed sectors */ - header.l2_bits =12 ;/* 32 KB L2 tables */ - }else { - header.cluster_bits =12 ;/* 4 KB clusters */ - header.l2_bits =9 ;/* 4 KB L2 tables */ - } + } + header.cluster_bits =12 ;/* 4 KB clusters */ + header.l2_bits =9 ;/* 4 KB L2 tables */ + header_size = (header_size +7 ) & ~7 ; shift = header.cluster_bits + header.l2_bits; l1_size = ((total_size *512 ) + (1LL << shift) -1 ) >> shift;