Re: [RFC v2 PATCH] kvm tools, qcow: Add the support for copy-on-write clusters

2011-11-21 Thread Kevin Wolf
Am 20.11.2011 11:59, schrieb Pekka Enberg: On Sun, 2011-11-20 at 14:14 +0800, Lan, Tianyu wrote: OK. Thx. But fsync is too slow. I try to find a way to sync a range of file. Are there any solutions to meet my purpose? On Sun, 2011-11-20 at 08:23 +0200, Sasha Levin wrote: fdatasync() is as

RE: [RFC v2 PATCH] kvm tools, qcow: Add the support for copy-on-write clusters

2011-11-20 Thread Pekka Enberg
On Sun, 2011-11-20 at 14:14 +0800, Lan, Tianyu wrote: OK. Thx. But fsync is too slow. I try to find a way to sync a range of file. Are there any solutions to meet my purpose? On Sun, 2011-11-20 at 08:23 +0200, Sasha Levin wrote: fdatasync() is as good as it'll get. tbh, maybe we should

RE: [RFC v2 PATCH] kvm tools, qcow: Add the support for copy-on-write clusters

2011-11-19 Thread Lan, Tianyu
How about using the sync_file_range to sync the metadata? -Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of Lan, Tianyu Sent: Saturday, November 19, 2011 10:09 AM To: Kevin Wolf Cc: penb...@kernel.org; kvm@vger.kernel.org;

RE: [RFC v2 PATCH] kvm tools, qcow: Add the support for copy-on-write clusters

2011-11-19 Thread Sasha Levin
On Sat, 2011-11-19 at 23:30 +0800, Lan, Tianyu wrote: How about using the sync_file_range to sync the metadata? sync_file_range() is only a hint, it doesn't actually assure anything. -- Sasha. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

RE: [RFC v2 PATCH] kvm tools, qcow: Add the support for copy-on-write clusters

2011-11-19 Thread Lan, Tianyu
OK. Thx. But fsync is too slow. I try to find a way to sync a range of file. Are there any solutions to meet my purpose? Thanks Tianyu Lan -Original Message- From: Sasha Levin [mailto:levinsasha...@gmail.com] Sent: Sunday, November 20, 2011 12:27 AM To: Lan, Tianyu Cc: Kevin Wolf;

RE: [RFC v2 PATCH] kvm tools, qcow: Add the support for copy-on-write clusters

2011-11-19 Thread Sasha Levin
On Sun, 2011-11-20 at 14:14 +0800, Lan, Tianyu wrote: OK. Thx. But fsync is too slow. I try to find a way to sync a range of file. Are there any solutions to meet my purpose? fdatasync() is as good as it'll get. tbh, maybe we should just consider opening QCOW images with O_SYNC and just get

RE: [RFC v2 PATCH] kvm tools, qcow: Add the support for copy-on-write clusters

2011-11-19 Thread Lan, Tianyu
Yeah. That will make the work quite simple. After testing, fdatasync is better than fsync. -Original Message- From: Sasha Levin [mailto:levinsasha...@gmail.com] Sent: Sunday, November 20, 2011 2:23 PM To: Lan, Tianyu Cc: Kevin Wolf; penb...@kernel.org; kvm@vger.kernel.org;

[RFC v2 PATCH] kvm tools, qcow: Add the support for copy-on-write clusters

2011-11-18 Thread Lan Tianyu
When meeting request to write the cluster without copied flag, allocate a new cluster and write original data with modification to the new cluster. This also adds support for the writing operation of the qcow2 compressed image. After testing, image file can pass through qemu-img check. Please

Re: [RFC v2 PATCH] kvm tools, qcow: Add the support for copy-on-write clusters

2011-11-18 Thread Kevin Wolf
Am 18.11.2011 09:47, schrieb Lan Tianyu: When meeting request to write the cluster without copied flag, allocate a new cluster and write original data with modification to the new cluster. This also adds support for the writing operation of the qcow2 compressed image. After testing, image file

RE: [RFC v2 PATCH] kvm tools, qcow: Add the support for copy-on-write clusters

2011-11-18 Thread Lan, Tianyu
Hi Kevin: Thanks for your review. The following means that there should be a fsync after updating metadata(refcunt block, l1 table and l2 table). Thanks Tianyu Lan -Original Message- + /*write l2 table*/ + l2t-dirty = 1; + if