From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRORd-0003cd-2X for qemu-devel@nongnu.org; Wed, 02 Oct 2013 11:34:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRORT-0004ja-AO for qemu-devel@nongnu.org; Wed, 02 Oct 2013 11:34:33 -0400 Received: from mx.ipv6.kamp.de ([2a02:248:0:51::16]:34307 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRORS-0004iz-Vc for qemu-devel@nongnu.org; Wed, 02 Oct 2013 11:34:23 -0400 Message-ID: <524C3CF9.7000508@kamp.de> Date: Wed, 02 Oct 2013 17:34:17 +0200 From: Peter Lieven MIME-Version: 1.0 References: <1380723636-18456-1-git-send-email-pl@kamp.de> <20131002150614.GA14662@stefanha-thinkpad.redhat.com> <524C3828.9000706@redhat.com> In-Reply-To: <524C3828.9000706@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv4] block/get_block_status: avoid redundant callouts on raw devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, stefanha@redhat.com, Stefan Hajnoczi , qemu-devel@nongnu.org, anthony@codemonkey.ws, ronniesahlberg@gmail.com Am 02.10.2013 17:13, schrieb Paolo Bonzini: > Il 02/10/2013 17:06, Stefan Hajnoczi ha scritto: >> Sorry I didn't review this earlier but this flag looks hacky and I'm not >> confident about merging the patch yet. >> >> The patch makes me wonder if the raw_bsd driver should avoid calling >> bs->file itself: >> >> return BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | >> (sector_num << BDRV_SECTOR_BITS); >> >> Let block.c:bdrv_co_get_block_status() call down into bs->file. >> >> The problem is then the protocol cannot report unallocated sectors with >> this approach. >> >> I think we want to preserve bs' offset while taking the other flags from >> bs->file (DATA, ZERO). > This would cause other changes. For example, a qcow2 with full metadata > preallocation (i.e. all L2 tables are there but it points to holes) > would not return DATA anymore. I think this is wrong, and especially a > change from the old is_allocated API. > > However, a variant on this idea could be to return > > BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | > (sector_num << BDRV_SECTOR_BITS); > > and then BDRV_BLOCK_RAW would mean "take DATA and ZERO from bs->file". I am fine with that. Peter