Re: [libvirt] [libvirt-php] memory overflow when using libvirt_list_networks
On 18/04/15 04:25 AM, Michal Novotny wrote: > Hi Kash, > > there were no patches for libvirt-php for a long time. Are you sure > this is libvirt-php related and not a bug in libvirt itself? > > Thanks, > Michal > I've just started using libvirt-php this week but I've been using libvirt for ages. I did learn last night, the difference between my two systems that is relevant is that the overflow system ran Gentoo while the "working" system ran Debian. I was missing a USE flag for "virt-network" on the Gentoo machine. It is a development environment that I am attempting to create a supported configuration with, so these kinds of missing USE flags and other things are just facts of life I must accept. Unfortunately, it was kind-of difficult to get this information or even workaround it without rebuilding libvirt on the Gentoo machine, which means I won't be able to give a proper error message to users who encounter this problem as well. It's a problem in libvirt-php to overflow when requesting libvirt_networks_list on a machine without networking support compiled in. The PHP bindings should error out properly, not memory overflow and put errors in httpd log with cryptic results in the interpreter :-) I do like the PHP bindings but they appear to be lacking attention. Am I the only one using it? ;-) Kash Pande Jentu Technologies, Inc http://jentu-networks.com -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [libvirt-php] memory overflow when using libvirt_list_networks
Finding lots of bad behaviour here: [Fri Apr 17 23:44:04.590626 2015] [:error] [pid 31714] [client 127.0.0.1:38103] PHP Warning: libvirt_list_networks(): this function is not supported by the connection driver: virConnectNumOfNetworks [Fri Apr 17 23:44:04.590655 2015] [:error] [pid 31714] [client 127.0.0.1:38103] PHP Fatal error: Out of memory (allocated 524288) (tried to allocate 18446744073709551608 bytes) There's no way to check if this exists... I noticed the following about versions: - this system works fine (Git): libvirt 1.2.9 Array ( [libvirt.release] => 9 [libvirt.minor] => 2 [libvirt.major] => 1 [connector.version] => 0.5.0 [connector.major] => 0 [connector.minor] => 5 [connector.release] => 0 ) - this system has problems (Git) libvirt 1.2.12 Array ( [libvirt.release] => 12 [libvirt.minor] => 2 [libvirt.major] => 1 [connector.version] => 0.5.0 [connector.major] => 0 [connector.minor] => 5 [connector.release] => 0 [type.release] => 12 [type.minor] => 2 [type.major] => 1 ) When I do a version check to only do network list for version under .12, I get this: [Fri Apr 17 23:44:43.608308 2015] [:error] [pid 31689] [client 127.0.0.1:38216] PHP Warning: libvirt_network_get(): this function is not supported by the connection driver: virNetworkLookupByName Which causes a cascade of other errors if you're not checking for problems each step along the way. Kash Pande Jentu Technologies, Inc http://jentu-networks.com -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] request for backwards compatibility
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. Thanks, Kash Pande Jentu Technologies, Inc. http://jentu-networks.com -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list