[libvirt] using php-libvirt libvirt_domain_is_active function

Eduard B eduardbc at hotmail.com
Sun Nov 13 15:37:20 UTC 2011


Hi All,

Im trying to figure how to use  libvirt_domain_is_active but I'm unable to find what I am doing wrong.
I tested it with  php-libvirt-0.4.4 an with 0.4.3 but i have the same problem 

Im using libvirt-0.9.6-2.fc16.x86_64 with the following code

Can someone point me in the right direction with the use of  libvirt_domain_is_active ?
Thanks

------8<------CODE --------8<------------------------------------

 print_r ( libvirt_version() );

$domains=libvirt_list_domains($conn);
print_r ($domains);

foreach ( $domains as $domain ) {
    print "$domain\n";
    print libvirt_domain_is_active($domain);
}

---------8<------- OUTPUT ----------------8<-------------------
Array
(
    [libvirt.release] => 6
    [libvirt.minor] => 9
    [libvirt.major] => 0
    [connector.version] => 0.4.3
    [connector.major] => 0
    [connector.minor] => 4
    [connector.release] => 3
)


Array
(
    [0] => Domain-0
    [1] => vm1
    [2] => vm2
    [3] => vm3
)
Domain-0
PHP Warning:  libvirt_domain_is_active() expects parameter 1 to be resource, integer given in /var/www/html/libvirt/index.php on line 20
PHP Warning:  libvirt_domain_is_active(): Invalid arguments in /var/www/html/libvirt/index.php on line 20
vm1
PHP Warning:  libvirt_domain_is_active() expects parameter 1 to be resource, integer given in /var/www/html/libvirt/index.php on line 20
PHP Warning:  libvirt_domain_is_active(): Invalid arguments in /var/www/html/libvirt/index.php on line 20
vm2
PHP Warning:  libvirt_domain_is_active() expects parameter 1 to be resource, integer given in /var/www/html/libvirt/index.php on line 20
PHP Warning:  libvirt_domain_is_active(): Invalid arguments in /var/www/html/libvirt/index.php on line 20
vm3
PHP Warning:  libvirt_domain_is_active() expects parameter 1 to be resource, integer given in /var/www/html/libvirt/index.php on line 20
PHP Warning:  libvirt_domain_is_active(): Invalid arguments in /var/www/html/libvirt/index.php on line 20

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111113/c740cb6a/attachment-0001.htm>


More information about the libvir-list mailing list