[virt-tools-list] libvirt and virt-manager default Xen blktap driver name for file images, tap vs tap2?

Cole Robinson crobinso at redhat.com
Mon Jun 10 16:13:29 UTC 2013


On 06/10/2013 12:10 PM, Pasi Kärkkäinen wrote:
> On Mon, Jun 10, 2013 at 12:04:24PM -0400, Cole Robinson wrote:
>> On 06/09/2013 01:07 PM, Pasi Kärkkäinen wrote:
>>> Hello,
>>>
>>> Does anyone know where/how to set the default libvirt Xen blktap "driver name" for disk image files?
>>>
>>> If I have "blktap" module loaded in dom0 kernel, and I do this:
>>>
>>> virt-install -d -n blktaptest01 -r 2048 --vcpus=2 --disk /var/lib/libvirt/images/blktaptest01.img,size=8 --vnc -p -l "http://ftp.funet.fi/pub/mirrors/centos.org/6.4/os/x86_64"
>>>
>>> which results in this generated libvirt xml config for the VM:
>>>
>>>     <disk type='file' device='disk'>
>>>       <driver name='tap' type='aio'/>
>>>       <source file='/var/lib/libvirt/images/blktaptest01.img'/>
>>>       <target dev='xvda' bus='xen'/>
>>>     </disk>
>>>
>>> .. which doesn't seem to work for me with Xen 4.2.2 using xm/xend, and libvirt 0.10.x.
>>>
>>> The problem is there's no tapdisk process started in dom0, and the block device cannot be 
>>> initialized or accessed inside the VM. I have the same problem with virt-manager, 
>>> using the "new VM" wizard with disk image files.
>>>
>>> The correct "driver name" for libvirt is "tap2", which works for me, 
>>> so I need to manually edit the libvirt xml config to make the VM boot/work:
>>>
>>>     <disk type='file' device='disk'>
>>>       <driver name='tap2' type='aio'/>
>>>       <source file='/var/lib/libvirt/images/blktaptest01.img'/>
>>>       <target dev='xvda' bus='xen'/>
>>>     </disk>
>>>
>>> This matches xm/xend behaviour with text config files for VMs. 
>>> I need to use tap2 there aswell on the disk = [] line.
>>>
>>> Where should I choose/set/patch the default libvirt driver name? Is that in libvirt sources,
>>> or in virt-install/virt-manager ? I tried reading the libvirt "xen" driver source, 
>>> but I couldn't find any "default" setting there.. 
>>>
>>
>> Hmm. This is old old behavior in virtinst. If the blktap module is loaded on
>> the local host we use the 'tap' driver.
>>
> 
> Yep, I noticed, removing "blktap" resulted in different behaviour (using the file: driver).
>  
>> According to the libvirt log, tap2 has been available since xen 4.0, so
>> virtinst should probably check if xen >= 4.0 and libvirt >= 0.9.7, which is
>> the first libvirt version where it sounds like tap2 is usable. This would be a
>> check in virtinst/support.py
>>
> 
> Ok. Does virt-manager also use virtinst internally? 
> Or do I need to separately patch virt-manager ? 
> 

All the code is in the same repo and shared between virt-* tools. However 'git
grep blktap' shows an instance in virtManager/addhardware.py where we are
duplicating the check, so that would need to be handled as well. Thanks for
looking into this!

git clone git://git.fedorahosted.org/virt-manager.git

- Cole




More information about the virt-tools-list mailing list