]> xenbits.xen.org Git - xenclient/xen-pq.git/commitdiff
tools-hvm-info: works perfectly
authorAlexandre Bique <alexandre.bique@citrix.com>
Thu, 11 Jun 2009 13:33:44 +0000 (13:33 +0000)
committerAlexandre Bique <alexandre.bique@citrix.com>
Thu, 11 Jun 2009 13:33:44 +0000 (13:33 +0000)
master/tools-hvm-info

index 98beacf9cf202b838b34bbba41fa8a068c6c819d..c66c9776490ee16f3a6fb94dfa4267bfbb96ac53 100644 (file)
@@ -568,29 +568,35 @@ index 0000000..fc13931
 +.SECONDARY:
 diff --git a/tools/hvm-info/main.c b/tools/hvm-info/main.c
 new file mode 100644
-index 0000000..243d546
+index 0000000..f7e0119
 --- /dev/null
 +++ b/tools/hvm-info/main.c
-@@ -0,0 +1,31 @@
+@@ -0,0 +1,37 @@
 +#include <xenctrl.h>
 +#include <stdio.h>
++#include <string.h>
++#include <errno.h>
 +
 +int main(int argc, char **argv)
 +{
++#define MAX_CPU_ID 255
 +  int xc_handle;
 +  xc_physinfo_t info;
++  xc_cpu_to_node_t map[MAX_CPU_ID + 1];
 +  int has_hvm, has_hvm_directio;
 +
 +  xc_handle = xc_interface_open();
 +  if (xc_handle == -1)
 +  {
-+    fprintf(stderr, "xc_interface_open() failed.\n");
++    fprintf(stderr, "xc_interface_open() failed: %s.\n", strerror(errno));
 +    return 1;
 +  }
 +
++  set_xen_guest_handle(info.cpu_to_node, map);
++  info.max_cpu_id = MAX_CPU_ID;
 +  if (xc_physinfo(xc_handle, &info) != 0)
 +  {
-+    fprintf(stderr, "xc_physinfo() failed.\n");
++    fprintf(stderr, "xc_physinfo() failed: %s.\n", strerror(errno));
 +    return 1;
 +  }
 +