可以在libvirt python中调用virConnectDomainXMLToNative吗?

可以在libvirt python中调用virConnectDomainXMLToNative吗?,python,xen,libvirt,Python,Xen,Libvirt,我需要能够使用libvirt-python将域的XML配置导出到libvirt下的XEN-config格式。显然,要打这个电话,您可以在C中使用以下命令: virConnectDomainXMLToNative Reads a domain XML configuration document, and generates a native configuration file describing the domain. The format of the native data is hy

我需要能够使用libvirt-python将域的XML配置导出到libvirt下的XEN-config格式。显然,要打这个电话,您可以在C中使用以下命令:

virConnectDomainXMLToNative

Reads a domain XML configuration document, and generates a native configuration file describing the domain. The format of the native data is hypervisor dependant.

conn:   a connection object
nativeFormat:   configuration format exporting to
domainXml:  the domain configuration to export
flags:  extra flags; not used yet, so callers should always pass 0
Returns:    a 0 terminated UTF-8 encoded native config datafile, or NULL in case of error. the caller must free() the returned value.
但是,Python中没有等效的函数

我注意到您可以在libvirt python中调用某些C函数。但是,当我使用helplibvirt时,我在当前的调用列表中看不到这一点。顺便说一句,我正在使用CentOS 5提供的libvirt python包

在Python中是否有方法进行调用并将domain.xml转换为xen config?

根据,以virConnect开头的函数映射到Python中virConnect对象的方法。因此,您应该创建一个virConnect对象,然后调用其domainXMLToNative方法


如果这仍然不起作用,您可以使用该模块从共享库调用函数。

它似乎要求我至少升级到libvirt和libvirt python 0.7x。我想这就是前进的方向。