qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Uri Lublin <uril@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] qemu: block.c: introducing "fmt:FMT:" prefix to image-filenames
Date: Thu, 08 Jan 2009 21:09:08 +0200	[thread overview]
Message-ID: <49664F54.7050908@redhat.com> (raw)
In-Reply-To: <20090108185256.GA8669@redhat.com>

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.

  parent reply	other threads:[~2009-01-08 19:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08 18:15 [Qemu-devel] qemu: block.c: introducing "fmt:FMT:" prefix to image-filenames Uri Lublin
2009-01-08 18:52 ` Daniel P. Berrange
2009-01-08 19:04   ` Anthony Liguori
2009-01-08 19:09   ` Uri Lublin [this message]
2009-01-08 19:13     ` Daniel P. Berrange
2009-01-08 19:15       ` Uri Lublin
2009-01-08 23:18         ` Jamie Lokier
2009-01-08 23:23           ` Anthony Liguori
2009-01-09  0:15             ` Jamie Lokier
2009-01-09  9:17           ` Kevin Wolf
2009-01-11 20:42             ` Uri Lublin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49664F54.7050908@redhat.com \
    --to=uril@redhat.com \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).