[libvirt] request for backwards compatibility

Kash Pande kash at VTOLTECH.COM
Fri Apr 17 00:36:34 UTC 2015

Hi there,

I've been trying to use libvirt-php to bring libvirt support to jentu
which runs on mostly Debian Wheezy machines. I've had a few bugs setting
network devices as active with the released (0.4.8) version:

PHP Warning:  libvirt_network_get_information(): Invalid XPath node for
network gateway IP address in /var/www/libjentu-virt.php on line 54
PHP Warning:  libvirt_network_set_active() expects exactly 2 parameters,
1 given in /var/www/libjentu-virt.php on line 55
PHP Warning:  libvirt_network_set_active(): Invalid arguments in
/var/www/libjentu-virt.php on line 55

Building the latest Git repository results in:

gcc -g -O2 -Wall -fpic -DCOMPILE_DL_LIBVIRT=1 -I/usr/include/php5
-I/usr/include/php5/main -I/usr/include/php5/TSRM
-I/usr/include/php5/Zend -I/usr/include/php5/ext
-I/usr/include/php5/ext/date/lib -c -o libvirt-php.o libvirt-php.c
-I/usr/include/libxml2    -DHAVE_CONFIG_H
libvirt-php.c: In function ‘zm_startup_libvirt’:
libvirt-php.c:1179:2: error: ‘VIR_DOMAIN_VCPU_GUEST’ undeclared (first
use in this function)
libvirt-php.c:1179:2: note: each undeclared identifier is reported only
once for each function it appears in
libvirt-php.c: In function ‘get_next_free_numeric_value’:
libvirt-php.c:2719:6: warning: format ‘%x’ expects argument of type
‘unsigned int *’, but argument 3 has type ‘long int *’ [-Wformat]
make[2]: *** [build] Error 1

And this is because debian wheezy has an old version of libvirt that
does not have this declared.

The proper solution looks like it'd be a configure-time check and enable
or disable the new VCPU guest modifiers if they are not available
because I'm not so sure wheezy will ever get a newer version of libvirt.


Kash Pande
Jentu Technologies, Inc.

More information about the libvir-list mailing list