[Libvir] C bindings

Richard Jones rjones at redhat.com
Mon Dec 10 11:08:23 UTC 2007


On 10 Dec 2007, at 07:36, Katti, Vadiraj (STSD-Openview) wrote:

>
> Hi All,
> I'm new to Xen world and am in the process of collecting performance  
> information of various guests from dom0. Can somebody help me out  
> with these problems.
>
> 1. I downloaded libvirt-0.3.3 src and did a 'make' and I'm seeing  
> this problem.
>
> xen_internal.c: In function 'xenHypervisorDomainGetOSType':
> xen_internal.c:2711: error: 'DOMFLAGS_HVM' undeclared (first use in  
> this function)
> xen_internal.c:2711: error: (Each undeclared identifier is reported  
> only once
> xen_internal.c:2711: error: for each function it appears in.)
> xen_internal.c: In function 'xenHypervisorGetDomInfo':
> xen_internal.c:2943: error: 'DOMFLAGS_HVM' undeclared (first use in  
> this function)
> make[2]: *** [libvirt_la-xen_internal.lo] Error 1
>
Can you:

find /usr/include -name '*.h' | xargs grep DOMFLAGS_DYING

and also tell us what version of xen, xen-devel and kernel-xen you  
have installed.

> 2. I want to know what are the rpm that the Xen server must have to  
> pull out the performance data of various guests.
>
You will require libvirt >= 0.3.3

> 3. My Xen server now has these rpms :
> # rpm -qa |grep libvirt
>       libvirt-0.2.0-0.16
>       libvirt-python-0.2.0-0.16
>
> Do I need any other rpms to compile my c programs ? Is there any  
> document which says how I can compile my c-program using libvirt ? I  
> tried running info1 example in debug mode and I get this error :
>
libvirt-devel contains the C development API, header files and library.
> ./info1
> libvirt: virConnectOpenReadOnly (name=(null))
> libvirt: virInitialize ()
> libvirt: virInitialize ()
> libvirt: virInitialize ()
> libvirt: virInitialize ()
> libvirt: virInitialize ()
> libvirt: virInitialize ()
> libvirt: virInitialize ()
> libvirt: virInitialize ()
> libvirt: virInitialize ()
> libvirt: do_open: proceeding with name=xen:///
> libvirt: do_open: trying driver 0 (Test) ...
> libvirt: do_open: driver 0 Test returned DECLINED
> libvirt: do_open: trying driver 1 (QEMU) ...
> libvirt: do_open: driver 1 QEMU returned DECLINED
> libvirt: do_open: trying driver 2 (Xen) ...
> libvirt: xenUnifiedOpen: trying Xen sub-driver 0
> libvirt: xenUnifiedOpen: Xen sub-driver 0 open ok
> libvirt: xenUnifiedOpen: trying Xen sub-driver 2
> libvirt: xenUnifiedOpen: Xen sub-driver 2 open ok
> libvirt: xenUnifiedOpen: trying Xen sub-driver 3
> libvir: Xen Store error : could not use Xen hypervisor entry failed  
> to connect to Xen Store
> libvirt: xenUnifiedOpen: Xen sub-driver 3 open failed
> libvirt: do_open: driver 2 Xen returned ERROR
> Failed to connect to hypervisor
>
Apparently the xenstore daemon isn't running.  This is a fairly  
fundamental part of Xen.  Again, need to know what version of Xen  
you're running.
> 4. what is libvirt_proxy ? What is its use ?
> I assume this is used to connect to hypervisor (am I right ?) When I  
> run this, it says "Failed to open Xen hypervisor"
>

No, libvirt_proxy is something you can ignore.

libvirt tries several methods to connect to Xen, including: direct  
hypervisor calls and connecting to xend.  It can also remotely access  
a libvirtd daemon.

Rich.




More information about the libvir-list mailing list