From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrjSH-0001mP-9f for qemu-devel@nongnu.org; Wed, 26 Jun 2013 02:43:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrjSF-0001o8-QN for qemu-devel@nongnu.org; Wed, 26 Jun 2013 02:43:49 -0400 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:59599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrjSF-0001ni-4j for qemu-devel@nongnu.org; Wed, 26 Jun 2013 02:43:47 -0400 Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Jun 2013 12:06:44 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 19BBF394004E for ; Wed, 26 Jun 2013 12:13:41 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5Q6hvrM27197682 for ; Wed, 26 Jun 2013 12:13:57 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r5Q6heju025009 for ; Wed, 26 Jun 2013 16:43:41 +1000 Date: Wed, 26 Jun 2013 12:16:04 +0530 From: Bharata B Rao Message-ID: <20130626064604.GE9966@in.ibm.com> References: <20130625113911.GD3539@dhcp-200-207.str.redhat.com> <20130626031447.GD9966@in.ibm.com> <33D3F375-B15B-41BE-8033-4D1A088F25A8@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33D3F375-B15B-41BE-8033-4D1A088F25A8@kamp.de> Subject: Re: [Qemu-devel] block: Review of .has_zero_init use Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: Kevin Wolf , josh.durgin@dreamhost.com, tailai.ly@taobao.com, qemu-devel@nongnu.org, rjones@redhat.com, stefanha@redhat.com, morita.kazutaka@lab.ntt.co.jp On Wed, Jun 26, 2013 at 07:59:27AM +0200, Peter Lieven wrote: > > Am 26.06.2013 um 05:14 schrieb Bharata B Rao : > > > On Tue, Jun 25, 2013 at 01:39:11PM +0200, Kevin Wolf wrote: > >> > >> Can you please review for the gluster, rbd, sheepdog and ssh driver > >> whether it's safe to assume that the image reads back as zeros after > >> bdrv_create? > > > > Gluster supports both file and block backends. While the above is true for > > file backend (which uses ftruncate), the same is not true for > > block backend (which uses lvcreate & lvresize). > > > > So overall it is not safe to assume that an image on GlusterFS volume > > reads back as zeroes after create. > > Okay, so for safety we have to return has_zero_init = 0. Erroneously assuming > a device is zero initialized can bring severe filesystem corruption. > > Do you see a way to query the information of the underlaying > backend from the storage and return 1 or 0 conditionally? Right now no. There have been efforts to get the capabilities (file, block etc) of gluster volume from gluster cmdline, but there haven't been discussions about providing such capabilities from libgfapi which is the library QEMU uses to talk with gluster. I see has_zero_init being used from qemu-img convert path. Is there any other use of this in QEMU ? Regards, Bharata.