Received: from eggs.gnu.org ([140.186.70.92]:53610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZgu9-0007sf-OT for qemu-devel@nongnu.org; Sun, 11 Dec 2011 05:45:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZgu8-0002LM-LF for qemu-devel@nongnu.org; Sun, 11 Dec 2011 05:45:13 -0500 Received: from mail.avalus.com ([89.16.176.221]:56873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZgu8-0002LB-Gx for qemu-devel@nongnu.org; Sun, 11 Dec 2011 05:45:12 -0500 Date: Sun, 11 Dec 2011 10:45:06 +0000 From: Alex Bligh Message-ID: <98D05E44527FF395E0A60016@nimrod.local> In-Reply-To: <4EE0B059.4010903@redhat.com> References: <958CDBC95A3252B592B5E3C9@nimrod.local> <4EE0B059.4010903@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: [Qemu-devel] RFC: raw device support for block device targets Reply-To: Alex Bligh List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, Alex Bligh --On 8 December 2011 13:40:57 +0100 Kevin Wolf wrote: >> qemu-img convert appears to support block devices as input, but not >> as output. That is irritating, as when using qemu-img convert to >> convert qcow to raw on a block partition, an intermediate file has >> to be used, which slows things down and pointlessly uses disk space. >> >> The problem is that ftruncate() is being called on the output file >> in order ensure it is sufficiently large, and this fails on >> block devices. ... > > Creating an image on a block device shouldn't even call raw_create(), > but only hdev_create(), which doesn't try to truncate the device, but > just uses lseek to make sure that it's large enough. > > Which qemu version are you using and what's your command line? I was testing on: amb@alex-test:~$ qemu-img --version qemu-img version 0.12.3, Copyright (c) 2004-2008 Fabrice Bellard though the patch was against current trunk. Command line simply: qemu-img convert -O raw test.qcow /dev/xyz Fails on ftruncate() as verified with strace. I must admit I only 'tested' on trunk by reading the source. -- Alex Bligh