[et-mgmt-tools] [PATCH] can not specify the type of driver device

Daniel P. Berrange berrange at redhat.com
Wed Jul 11 21:55:38 UTC 2007

On Wed, Jul 11, 2007 at 03:01:10PM +0900, Saori Fukuta wrote:
> There are two kinds of the meaning for the "driver type" now. The one 
> of the kind is using for operating the disk, and another is using for
> creating the disk. Is that right?
> So do we need following two options ? 
>     1) --sub-type = SUBTYPE
>     2) --disk-format = DISKFMT
> And I am trying to address the former (--sub-type).
> 1) --sub-type
> The "--sub-type" option that actually I wanted to add is choosing the 
> mode for operating the disk. As you said, this is just giving the user
> the ability to specify a sub-type for blktap based files.
> For example, I meant that was "driver type" of XML configuration:
>      <disk type='file' device='disk'>
>       <driver name='tap' type='sync'/>  <---"driver type"
>       <source file='/root/test.img'/>
>       <target dev='xvda'/>
>     </disk>
> So we have to prepare the name of sub type:
>     SUB_TYPE_AIO = "aio"
>     SUB_TYPE_SYNC = "sync"
> and add "--sub-type" option.

I don't think we want a --sub-type argument - it will almost never be
used - its not even neccessary for Xen HVM, or QEMU/KVM - its only Xen
paravirt which ever use it. We should be picking the sub-type automatically 
based on the disk  format given with the --disk-format arg.

> 2) --disk-format
> The "--disk-format" option that you offered is choosing the format type
> for creating disk. If we want to choose the format type, we have to 
> prepare following name of format type:
>     DRIVER_TAP_RAW = "raw"     # change the name. before this was "aio"
>     DRIVER_TAP_QCOW2 = "qcow2" # add.
>     DRIVER_TAP_QCOW = "qcow"   
>     DRIVER_TAP_COW = "cow"     # add.
>     DRIVER_TAP_VMDK = "vmdk"
>     DRIVER_TAP_CLOOP = "cloop" # add.
>     DRIVER_TAP_DMG = "dmg"     # add.
>     DRIVER_TAP_VPC = "vpc"     # add.

We need two sets of constants  - DRIVER_TAP_nnn as shown here, but also 
a seprate set of DISK_FORMAT_nnn constants. There will be pretty much the
same, except for the DISK_FORMAT_RAW vs DRIVER_TAP_AIO.

> >   - Makes sure the disk image we create is using appropriate file format
> >   - Automatically choose the best driver type to match the disk type.
> But I'm still not sure that how to choose the best driver format 
> automatically. Is it possible to choose that by the virtualization type
> (i.e. xen, qemu, kvm, or kqemu) ?

For QEMU / KVM, there's no need to specify a disk driver type - QEMU will
probe & determine the disk format automatically. So this is only ever going
to be needed for Xen. We can have a simple lookup table mapping disk formats
to blktap driver type.

  diskFormatDriverTapSubtype = (

> > writing lots of zeros (non-sparse). The other formats like vmdk, qcow,
> > etc have some special file structure that needs writing out. We could add
> > code for doing this in python in virt-install, or we could simply run the
> > 'qemu-img' command to create the file in non-raw case.
> Well, I prefer using the "qemu-img" command.

Ok, that's fine with me.

|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

More information about the et-mgmt-tools mailing list