[Libvir] XM config <-> XML config

Hi, I am using Fedora 7 with virt-manager to control my xen domains. I would like to delegate a pci device to one of my domU's. I know how this is done in the XM and sxp config files, but how is it done now? I read that libvirt can convert XM <-> XML and though I could export my current config to XM format, edit it and reimport. How is is done with libvirt? Thanks, Arik

On Wed, Jul 18, 2007 at 08:30:21PM +0200, Arik Raffael Funke wrote:
I am using Fedora 7 with virt-manager to control my xen domains. I would like to delegate a pci device to one of my domU's. I know how this is done in the XM and sxp config files, but how is it done now?
We don't support any config in the XML for delegating PCI devices at this point in time.
I read that libvirt can convert XM <-> XML and though I could export my current config to XM format, edit it and reimport. How is is done with libvirt?
To dump XML use virsh dumpxml [id|name|uuid] > [xmlfile] To reload it then use virsh define [xmlfile] Its not going to help much I'm afraid since we don't support PCI device delegation currently. Regards, Dan. -- |=- 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 -=|

Daniel P. Berrange wrote:
I read that libvirt can convert XM <-> XML and though I could export my current config to XM format, edit it and reimport. How is is done with libvirt?
To dump XML use
virsh dumpxml [id|name|uuid] > [xmlfile]
To reload it then use
virsh define [xmlfile]
Ok. That part I knew already. But does libvirt not also allow to convert the created xml configuration file to a XM configuration file? I.e. the type of config file that was traditionally used? At least in that I could define the pci delegation and start a virtual machine from it... I would just like to sort of "export" my current configuration from virt-manager.
Its not going to help much I'm afraid since we don't support PCI device delegation currently.
Thanks. Maybe I can get around it by simply not exporting back to xml but working with the xm config file. Cheers, Arik

On Thu, Jul 19, 2007 at 02:11:09AM +0200, Arik Raffael Funke wrote:
Daniel P. Berrange wrote:
I read that libvirt can convert XM <-> XML and though I could export my current config to XM format, edit it and reimport. How is is done with libvirt?
To dump XML use
virsh dumpxml [id|name|uuid] > [xmlfile]
To reload it then use
virsh define [xmlfile]
Ok. That part I knew already. But does libvirt not also allow to convert the created xml configuration file to a XM configuration file? I.e. the type of config file that was traditionally used? At least in that I could define the pci delegation and start a virtual machine from it...
Not as it stands, no. If we run against Xen 3.0.3 or earlier we do have code which reads/writes to /etc/xen files. For Xen 3.0.4 or later we use XenD's own APIs for managing inactive guest configs since they're more reliable than our hacked parser for /etc/xen files. Unfortunately i don't think XenD can export its inactive guests in the old /etc/xen format either. In retrospect it might have been better if when defining a new inactive guest, we used XenD's APIs *and* wrote the file to /etc/xen to try and get the best of both worlds. Now if you had a FC6 host handy, you could take the XML from FC7 and use 'virsh define' on the FC6 box to create the file in /etc/xen, and get a reasonable approximation. Dan. -- |=- 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 -=|
participants (2)
-
Arik Raffael Funke
-
Daniel P. Berrange