[Libvir] Re: XM config <-> XML config

Daniel P. Berrange berrange at redhat.com
Thu Jul 19 00:21:55 UTC 2007


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  -=| 




More information about the libvir-list mailing list