From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FsS3V-00055Q-SW for qemu-devel@nongnu.org; Mon, 19 Jun 2006 18:17:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FsS3S-00055E-Aq for qemu-devel@nongnu.org; Mon, 19 Jun 2006 18:17:12 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsS3S-00055B-5p for qemu-devel@nongnu.org; Mon, 19 Jun 2006 18:17:10 -0400 Received: from [70.116.9.243] (helo=localhost.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FsSDq-0006Lt-A7 for qemu-devel@nongnu.org; Mon, 19 Jun 2006 18:27:54 -0400 Message-ID: <4497223C.6000702@codemonkey.ws> Date: Mon, 19 Jun 2006 17:16:28 -0500 From: Anthony Liguori MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090905070609000803080201" Subject: [Qemu-devel] [PATCH] Increase default qcow cluster size to 4KB Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabrice Bellard , qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------090905070609000803080201 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Regards, Anthony Liguori --------------090905070609000803080201 Content-Type: text/plain; name="qemu-qcow-cluster.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-qcow-cluster.diff" # HG changeset patch # User Anthony Liguori # 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. diff -r 4fcb5f2d8d86 -r 76bb5704c9af block-qcow.c --- a/block-qcow.c Mon Jun 19 00:41:28 2006 +0000 +++ b/block-qcow.c Mon Jun 19 17:14:52 2006 -0500 @@ -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; --------------090905070609000803080201--