]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
X86-MCE: fix a bug of xen-mceinj tool
authorLiu, Jinsong <jinsong.liu@intel.com>
Sun, 18 Dec 2011 14:48:28 +0000 (14:48 +0000)
committerLiu, Jinsong <jinsong.liu@intel.com>
Sun, 18 Dec 2011 14:48:28 +0000 (14:48 +0000)
Fix a bug of xen-mceinj tool which used to test mce by software way.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24429:9587ccc2ae31
xen-unstable date:        Sun Dec 18 14:40:00 2011 +0000

tools/tests/mce-test/tools/xen-mceinj.c

index 1ca5c8c03c69eb8a81eb004401eba24515515ae7..4d72fe82ad5ca7f1c25ea6f6caa8be0866d777b4 100644 (file)
@@ -134,8 +134,12 @@ static int mca_cpuinfo(xc_interface *xc_handle)
 {
     struct xen_mc mc;
 
+    memset(&mc, 0, sizeof(struct xen_mc));
+
     mc.cmd = XEN_MC_physcpuinfo;
-    if (xc_mca_op(xc_handle, &mc))
+    mc.interface_version = XEN_MCA_INTERFACE_VERSION;
+
+    if (!xc_mca_op(xc_handle, &mc))
         return mc.u.mc_physcpuinfo.ncpus;
     else
         return 0;