<>于 2011年11月13日 23:37, Eduard B 写道:
libvirt_domain_is_active() wants a arg of resource type here. See the codes in examples/libvirt-php.c to get how to do it: <snip> 211
function get_domain_object($nameRes) {
212
if (is_resource($nameRes))
213
return $nameRes;
215
$dom=libvirt_domain_lookup_by_name($this->conn, $nameRes);
216
if (!$dom) {
217
$dom=libvirt_domain_lookup_by_uuid_string($this->conn, $nameRes);
218
if (!$dom)
219
return $this->_set_last_error();
220 }
222
return $dom;
223 }
</snip>what you want might be something like: foreach ($domains as $domname) { $domobj = get_domain_object($domname); print "$domain: " . libvirt_domain_is_active($domobj); } Osier |
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list