From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LL0Fm-00029n-0i for qemu-devel@nongnu.org; Thu, 08 Jan 2009 14:09:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LL0Fl-00029S-BZ for qemu-devel@nongnu.org; Thu, 08 Jan 2009 14:09:13 -0500 Received: from [199.232.76.173] (port=55403 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LL0Fl-00029N-4j for qemu-devel@nongnu.org; Thu, 08 Jan 2009 14:09:13 -0500 Received: from mx2.redhat.com ([66.187.237.31]:54705) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LL0Fk-0001DQ-KM for qemu-devel@nongnu.org; Thu, 08 Jan 2009 14:09:12 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n08J9BKk013016 for ; Thu, 8 Jan 2009 14:09:11 -0500 Message-ID: <49664F54.7050908@redhat.com> Date: Thu, 08 Jan 2009 21:09:08 +0200 From: Uri Lublin MIME-Version: 1.0 Subject: Re: [Qemu-devel] qemu: block.c: introducing "fmt:FMT:" prefix to image-filenames References: <496642BD.4010706@redhat.com> <20090108185256.GA8669@redhat.com> In-Reply-To: <20090108185256.GA8669@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org Daniel P. Berrange wrote: > On Thu, Jan 08, 2009 at 08:15:25PM +0200, Uri Lublin wrote: >> The purpose of this prefix is to >> 1. Provide a way to know the backing file format without probing >> it (setting the format upon creation time). >> 2. Enable using qcow2 format (and others) over host block devices. >> (only if the user specifically asks for it). >> >> If no fmt:FMT: is provided we go back to probing. > > I still don't like the fact that this is inventing a second syntax > for specifying format that's different to the syntax used for the > existing -drive parameter, which is > > -drive file=/some/path,format=qcow2,....other disk options... > >> backing file format is qcow2 (even though it's on a host block device) >> $ qemu-img create -b fmt:qcow2:/dev/loop0 -f qcow2 /tmp/uuu.qcow2 > > I'd prefer to see a '-F' flag to specify format of backing file and > leave syntax of existing -b arg alone > > $ qemu-img create -F qcow2 -b /dev/loop0 -f qcow2 /tmp/uuu.qcow2 I can easily modify qemu-img to support -F. The question is how to represent it such that when we run qemu it "knows" the backing file format. In other words what will '-F qcow2' do ? In this solution it will add 'fmt:qcow2:' as a prefix to the backing-file filename. > >> force backing file format to raw (no probing) >> $ qemu-img create -f raw /tmp/image1.raw 10G >> $ qemu-img create -b fmt:raw:/tmp/image1.raw -f qcow2 /tmp/image1.qcow2 > > $ qemu-img create -F raw -b /tmp/image1.raw -f qcow2 /tmp/image1.qcow2 > >> >> Or fat >> $ qemu-system-x86_64 -hda fmt:qcow2:/tmp/uuu.qcow2 -hdb >> fat:floppy:/tmp/images > > This is unneccessary, since -hda is deprecated, and there's a > new -drive arg that already has ability to set format explicitly, > as well as many other flags that you need when setting up disks. > > $ qemu-system-x86_64 \ > -drive index=0,format=qcow2,file=/tmp/uuu.qcow2 \ > -drive index=1,format=fat:floppy,file=/tmp/images Again that's true only for the leaf (writeable) images. Maybe the examples I've shown were confusing. The main issues we are trying to solve with this format are: 1. When opening a backing file, know what the format is to prevent probing. 2. Enable using qcow2 over host-devices (e.g qcow2 format image on an LVM lv such as /dev/mapper/mygroup-myvm) Regards, Uri.