[libvirt] virsh create and virsh dumpxml certain code location

Hi all, My libivrt is libvirt-0.8.3 I would like to add "tap2" recognition when using virsh create and dumpxml, but i could not find the certain function part that the logic of "create" and "dumpxml" are defined, Would anyone please give me some hints? Thanks Very Much Regards, Ben

Hi Jim, Thanks for your reply! I use xm create to create a tap2 disk and it works well disk = [ 'tap2:vhd:/root/tapdisk/vhd-f12,hda,w'] but virsh dumpxml can't get anything about the disk After i apply the patch, i can catch <disk> information by virsh dumpxml but it seems that it only recognize "tap" only but not tap2 <disk type='file' device='disk'> <driver name='tap' type='vhd'/> <source file='/root/tapdisk/vhd-f12'/> <target dev='hda' bus='ide'/> </disk> Afterwards i try to use this xml file to virsh create VM and no active disk is found. Moreover, if i change driver name='tap' to 'tap2' in xml myself, virsh seems doesn't support this type and raise error : error: POST operation failed: xend_post: error from xen daemon: (xend.err 'Error creating domain: Block device type "tap2" is invalid.' Should i modify the dumpxml and create function if i want to enable tap2:vhd ?? Thank you very much! Regards, Ben 2010/8/24 Jim Fehlig <jfehlig@novell.com>
benian wrote:
Hi all, My libivrt is libvirt-0.8.3 I would like to add "tap2" recognition when using virsh create and dumpxml,
Ah yes, I have a patch laying laying around that needs to go upstream. No better time to do that than now ..
Regards, Jim

benian wrote:
Hi Jim, Thanks for your reply!
I use xm create to create a tap2 disk and it works well
disk = [ 'tap2:vhd:/root/tapdisk/vhd-f12,hda,w']
but virsh dumpxml can't get anything about the disk
After i apply the patch, i can catch <disk> information by virsh dumpxml but it seems that it only recognize "tap" only but not tap2
<disk type='file' device='disk'> <driver name='tap' type='vhd'/> <source file='/root/tapdisk/vhd-f12'/> <target dev='hda' bus='ide'/> </disk>
Afterwards i try to use this xml file to virsh create VM and no active disk is found.
Opps, I forgot to account for tap2 in functions that generate sexpr. V2 attached. Regards, Jim

Hi Jim, Thank 's your patch! After applying the V2 patch, guestVM with tap2 driver-name in xml can be created and works well!! <disk type='file' device='disk'> <driver name='tap2' type='vhd'/> <source file='/root/tapdisk/vhd-f12-2'/> <target dev='hda' bus='ide'/> </disk> But dumpxml to the corresponding guestVM still get driver name='tap' <disk type='file' device='disk'> <driver name='tap' type='vhd'/> <source file='/root/tapdisk/vhd-f12-2'/> <target dev='hda' bus='ide'/> </disk> I am trying to chase the variable "def->driverName" located in src/domain_conf.c:5452: virBufferVSprintf(buf, " name='%s'", def->driverName); to find out why dumpxml still get wrong name Any hints will be very helpful for me Thank you very much! Regards, Ben 2010/8/25 Jim Fehlig <jfehlig@novell.com>
benian wrote:
Hi Jim, Thanks for your reply!
I use xm create to create a tap2 disk and it works well
disk = [ 'tap2:vhd:/root/tapdisk/vhd-f12,hda,w']
but virsh dumpxml can't get anything about the disk
After i apply the patch, i can catch <disk> information by virsh dumpxml but it seems that it only recognize "tap" only but not tap2
<disk type='file' device='disk'> <driver name='tap' type='vhd'/> <source file='/root/tapdisk/vhd-f12'/> <target dev='hda' bus='ide'/> </disk>
Afterwards i try to use this xml file to virsh create VM and no active disk is found.
Opps, I forgot to account for tap2 in functions that generate sexpr. V2 attached.
Regards, Jim

On Tue, Aug 24, 2010 at 11:31:14AM -0600, Jim Fehlig wrote:
From 6320c63d7c5077cf27050a567ca9d7ab7c17b189 Mon Sep 17 00:00:00 2001 From: Jim Fehlig <jfehlig@novell.com> Date: Tue, 24 Aug 2010 11:26:15 -0600 Subject: [PATCH] Add blktap2 support to xend driver
Xen4.0 includes a new blktap2 implementation, which is specified with 'tap2' prefix. AFAICT it's configuration syntax is identical to blktap, with exception of 'tap2' vs 'tap' prefix. This patch takes the simple approach of accepting and generating sexp containing 'tap2' prefix.
V2: Also generate sexp containing tap2 device type
ACK this looks good in combination with the test case posted separately. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On 08/31/2010 04:45 AM, Daniel P. Berrange wrote:
On Tue, Aug 24, 2010 at 11:31:14AM -0600, Jim Fehlig wrote:
From 6320c63d7c5077cf27050a567ca9d7ab7c17b189 Mon Sep 17 00:00:00 2001 From: Jim Fehlig<jfehlig@novell.com> Date: Tue, 24 Aug 2010 11:26:15 -0600 Subject: [PATCH] Add blktap2 support to xend driver
Xen4.0 includes a new blktap2 implementation, which is specified with 'tap2' prefix. AFAICT it's configuration syntax is identical to blktap, with exception of 'tap2' vs 'tap' prefix. This patch takes the simple approach of accepting and generating sexp containing 'tap2' prefix.
V2: Also generate sexp containing tap2 device type
ACK this looks good in combination with the test case posted separately.
Pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (4)
-
benian
-
Daniel P. Berrange
-
Eric Blake
-
Jim Fehlig