From 26f76d44540e457aaad136862436d112ced31efc Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 29 Apr 2012 01:15:46 +0200 Subject: [PATCH] Copy for safekeeping --- frontend/classes/class.controller.php | 2 +- frontend/testing/libvirt_create.php | 55 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 frontend/testing/libvirt_create.php diff --git a/frontend/classes/class.controller.php b/frontend/classes/class.controller.php index f2dabbb..40ba5e3 100644 --- a/frontend/classes/class.controller.php +++ b/frontend/classes/class.controller.php @@ -15,7 +15,7 @@ if(!isset($_CVM)) { die("Unauthorized."); } class Controller extends CPHPBaseClass { - + public $connection = null; } ?> diff --git a/frontend/testing/libvirt_create.php b/frontend/testing/libvirt_create.php new file mode 100644 index 0000000..e063e79 --- /dev/null +++ b/frontend/testing/libvirt_create.php @@ -0,0 +1,55 @@ + + 101 + 86c12009-e591-a159-6e9f-91d18b85ef78 + 2 + + exe + /sbin/init + + + + + + + + + + + + + + + + + +"; + + $hostname=libvirt_connect_get_hostname($conn); + echo ("hostname:$hostname\n"); + $domains = libvirt_domain_get_counts($conn); + echo ("Domain count: Active {$domains['active']},Inactive {$domains['inactive']}, Total {$domains['total']}\n"); + + $domains=libvirt_list_domains($conn); + foreach ($domains as $dom) + { + echo ("Name:\t".libvirt_domain_get_name($dom)."\n"); + echo("UUID:\t".libvirt_domain_get_uuid_string($dom)."\n"); + $dominfo=libvirt_domain_get_info($dom); + print_r($dominfo); + } + + echo("done"); +} +?>