Received: from eggs.gnu.org ([2001:4830:134:3::10]:56774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZltpR-0003OW-2f for qemu-devel@nongnu.org; Tue, 13 Oct 2015 03:17:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZltpL-0000YS-8P for qemu-devel@nongnu.org; Tue, 13 Oct 2015 03:16:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZltpL-0000YA-1e for qemu-devel@nongnu.org; Tue, 13 Oct 2015 03:16:51 -0400 From: Markus Armbruster References: <1444446115-3796-1-git-send-email-crosthwaite.peter@gmail.com> <561BD814.5090005@redhat.com> <561BDF26.4070405@redhat.com> <561BFB42.1080902@redhat.com> Date: Tue, 13 Oct 2015 09:16:47 +0200 In-Reply-To: <561BFB42.1080902@redhat.com> (John Snow's message of "Mon, 12 Oct 2015 14:26:10 -0400") Message-ID: <87a8rngrvk.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [RFC] Block device size rounding List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: Kevin Wolf , Peter Crosthwaite , "qemu-devel@nongnu.org Developers" , Sai Pavan Boddu , Peter Crosthwaite , stefanha@redhat.com John Snow writes: > On 10/12/2015 02:09 PM, Peter Crosthwaite wrote: >> On Mon, Oct 12, 2015 at 9:26 AM, Eric Blake wrote: >>> On 10/12/2015 09:56 AM, John Snow wrote: >>> >>>>> What is the correct action here though? If the file is writeable should >>>>> we just allow the device to extend its size? Is that possible already? >>>>> Just zero-pad read-only? >>>>> >>>> >>>> Read-only seems like an easy case of append zeroes. >>> >>> Yes, allowing read-only with append-zero behavior seems sane. This is tolerable. Do we want to warn? A reopen can bring in the read/write case. >>>> Read-write ... well, we can't write-protect just half of a 512k block. >>> >>>> Probably just forcibly increasing the size on RW or refusing to use the >>>> file altogether are probably the sane deterministic things we want. >>> >>> I'd lean towards outright rejection if the file size isn't up to snuff >>> for use as read-write. Forcibly increasing the size (done >>> unconditionally) still feels like magic, and may not be possible if the >>> size is due to something backed by a block device rather than a file. Concur. >> Inability to extend is easily detectable and can become a failure mode >> in it's own right. If we cant extend the file perhaps we can just >> LOG_UNIMP the data writes? Having to include in your user instructions >> "dd your already-on-SATA file system to this container just so it can >> work for SD" is a pain. Whenever QEMU proper can extend to the right size, qemu-img should be able to do so as well, shouldn't it? QEMU's error message could even explain how. > Fits within my "Always extend the size" answer. Failing to do so is a > good cause to fail. > > I'm not sure if this is the sort of thing that might require an extra > flag or option for compatibility reasons or not, though. If there is no > precedent for QEMU resizing a block device to make it compatible with a > particular device model, it's probably reasonable that no management > tool is expecting this to happen automatically either. > > Then again, it's still annoying that the current default is definitely > broken. > > I think this is going to boil down into an interface-and-expectations > argument. I am otherwise in favor of just forcing the resize whenever > possible and failing when it isn't. I agree it's about expectations. When I give QEMU read/write access to an image, I expect it to modify the image, but I don't expect it to resize it on its own. Perhaps my expectation is wrong. Do we have precedence?