[libvirt] Using Xen config files

Daniel Veillard veillard at redhat.com
Thu Jun 26 08:48:40 UTC 2008

On Thu, Jun 26, 2008 at 12:06:04AM -0400, Thomas Moyer wrote:
> Is it possible to directly utilize the Xen config files when using the  
> python bindings for libvirt? If not, is there any automated method of  
> converting the Xen config to a libvirt XML config?

  If the config files are installed in /etc/xen/ and assuming they
use only declaration and no other Python code, then libvirt if compiled
with xen support will look at them as definitions for domains. That
way you can just use for example 'virsh dumpxml' to get the associated
XML for the defined domain. Basically at the API level you do a domain
lookup based on the name (virDomainLookupByName) or UUID, and then 
call virDomainGetXMLDesc() on the result. Those calls are available at the
python binding.
  But there is no direct API to convert Xen config files to the XML,
and Xen config files being python code actually this didn't made 
sense to try to expose it at the API level which is defined in C. The
definitions really use XML as the format for libvirt, and as much
as possible they are not tied to the specifics of a given hypervisor.


Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

More information about the libvir-list mailing list