[Libvir] libver-python fix & test script

Angus Thomas athomas at redhat.com
Tue Feb 7 16:21:08 UTC 2006


Against the current CVS version, the python method libvir.open() is 
failing because it requires "name" as a parameter, but in src/libvir.c, 
virConnectOpen returns NULL if name is set. Very simple patch attached.

Also attached is a simple script to test reporting of domain state via 
the python bindings. Hopefully useful as a test of the python 
bindings/simple example of how to use them. It generates output like this:

[root at chaka ~]# ./libver-python-test
Attached to a hypervisor of type - Xen
There are currently 2 domains running

Domain ID 0 is named Domain-0
        State is Running
        maxMem is -4
        memory is 262224
        nrVirtCpu is 1
        cpuTime is 2294771524162

Domain ID 2 is named guest1
        State is Blocked
        maxMem is 131072
        memory is 131052
        nrVirtCpu is 1
        cpuTime is 34682760385

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libvir_open_name.patch
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20060207/95a84733/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libver-python-test
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20060207/95a84733/attachment-0003.ksh>


More information about the libvir-list mailing list