Skip to contentSkip to conversation

Increase default qcow cluster size to 4KB

PATCH New Anthony Liguori 1 participant 1 message Jun 19, 2006

lore
Share & tools
lore
#0 lore raw

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
diff -r 4fcb5f2d8d86 -r 76bb5704c9af block-qcow.c
@@ -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;