git://php-virt-control.org
/
php-virt-control.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
766e12b
)
XMLRPC: Add method for listing domain with states
author
Michal Novotny
<minovotn@redhat.com>
Mon, 8 Oct 2012 17:58:00 +0000 (19:58 +0200)
committer
Michal Novotny
<minovotn@redhat.com>
Mon, 8 Oct 2012 17:58:00 +0000 (19:58 +0200)
Signed-off-by: Michal Novotny <minovotn@redhat.com>
classes/libvirt-domain.php
patch
|
blob
|
history
diff --git
a/classes/libvirt-domain.php
b/classes/libvirt-domain.php
index
25854a9
..
ab755e2
100644
(file)
--- a/
classes/libvirt-domain.php
+++ b/
classes/libvirt-domain.php
@@
-366,5
+366,19
@@
$ret['state'] = $lv->domain_state_translate($ret['state']);
return $ret;
}
+
+ function rpc_list_state($idUser, $lv, $ret) {
+ $tmp = $lv->get_domains();
+
+ $ret = array();
+ for ($i = 0; $i < sizeof($tmp); $i++) {
+ $tmp2 = $lv->domain_get_info_call($tmp[$i]);
+ $state = $lv->domain_state_translate($tmp2[$tmp[$i]]['state']);
+
+ $ret[] = $tmp[$i].' ('.$state.')';
+ }
+
+ return $ret;
+ }
}
?>