From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK4GM-000375-3p for qemu-devel@nongnu.org; Wed, 20 Aug 2014 07:41:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK4GF-0001Yw-PW for qemu-devel@nongnu.org; Wed, 20 Aug 2014 07:41:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK4GF-0001Yl-J6 for qemu-devel@nongnu.org; Wed, 20 Aug 2014 07:41:03 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7KBf2uI032752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 20 Aug 2014 07:41:02 -0400 Date: Wed, 20 Aug 2014 13:40:59 +0200 From: Kevin Wolf Message-ID: <20140820114059.GF6122@noname.redhat.com> References: <1405117387-25539-1-git-send-email-mreitz@redhat.com> <1405117387-25539-2-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1405117387-25539-2-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/4] block: Correct bs->growable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , armbru@redhat.com Am 12.07.2014 um 00:23 hat Max Reitz geschrieben: > Currently, the field "growable" in a BDS is set iff the BDS is opened in > protocol mode (with O_BDRV_PROTOCOL). However, not every protocol block > driver allows growing: NBD, for instance, does not. On the other hand, > a non-protocol block driver may allow growing: The raw driver does. > > Fix this by correcting the "growable" field in the driver-specific open > function for the BDS, if necessary. > > Signed-off-by: Max Reitz I'm not sure I agree with bs->growable = true for raw. It's certainly true that the backend can technically provide the functionality that writes beyond EOF grow the file. That's not the point of bs->growable, though. The point of it was to _forbid_ it to grow even when it's technically possible (non-file protocols weren't really a thing back then, apart from vvfat, so the assumption was that it's always technically possible). growable was introduced with bdrv_check_request(), which is supposed to reject guest requests after the end of the virtual disk (and this fixed a CVE, see commit 71d0770c). You're now disabling this check for raw. I think we need to make sure that bs->growable is only set if it is opened for an image that has drv->requires_growing_file set and therefore not directly used by a guest. Well, except that with node-name a guest will be able to use any image in the chain... Might this mean that it's really a BlockBackend property? Kevin