From 9a969b86a9b040a3a6215da83a9a9f019959792e Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 19 Jan 2009 20:16:10 +0000 Subject: [PATCH] * src/xen_internal.c src/xend_internal.c: Relax NUMA checking for RHEL-5 and change the detection stategy for default Xen accesses, patch by Markus Armbruster daniel --- ChangeLog | 6 ++++++ src/xen_internal.c | 10 ++++++++-- src/xend_internal.c | 9 ++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1f7afe47b..a035267bd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Jan 19 20:58:34 CET 2009 Daniel Veillard + + * src/xen_internal.c src/xend_internal.c: Relax NUMA checking + for RHEL-5 and change the detection stategy for default Xen + accesses, patch by Markus Armbruster + Mon Jan 19 20:47:18 CET 2009 Daniel Veillard * src/xend_internal.c src/xm_internal.c: fix paravirt framebuffer diff --git a/src/xen_internal.c b/src/xen_internal.c index 947cd37dd0..12c1e1e3ee 100644 --- a/src/xen_internal.c +++ b/src/xen_internal.c @@ -93,6 +93,12 @@ typedef privcmd_hypercall_t hypercall_t; #define __HYPERVISOR_domctl 36 #endif +#ifdef WITH_RHEL5_API +#define SYS_IFACE_MIN_VERS_NUMA 3 +#else +#define SYS_IFACE_MIN_VERS_NUMA 4 +#endif + static int xen_ioctl_hypercall_cmd = 0; static int initialized = 0; static int in_init = 0; @@ -2150,7 +2156,7 @@ xenHypervisorBuildCapabilities(virConnectPtr conn, goto no_memory; - if (sys_interface_version >= 4) { + if (sys_interface_version >= SYS_IFACE_MIN_VERS_NUMA) { if (xenDaemonNodeGetTopology(conn, caps) != 0) { virCapabilitiesFree(caps); return NULL; @@ -3072,7 +3078,7 @@ xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *free /* * Support only sys_interface_version >=4 */ - if (sys_interface_version < 4) { + if (sys_interface_version < SYS_IFACE_MIN_VERS_NUMA) { virXenErrorFunc (conn, VIR_ERR_XEN_CALL, __FUNCTION__, "unsupported in sys interface < 4", 0); return -1; diff --git a/src/xend_internal.c b/src/xend_internal.c index df4b5e5d45..a53c2e9416 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -2547,6 +2547,8 @@ sexpr_to_xend_node_info(const struct sexpr *root, virNodeInfoPtr info) * Internal routine populating capability info with * NUMA node mapping details * + * Does nothing when the system doesn't support NUMA (not an error). + * * Returns 0 in case of success, -1 in case of error */ static int @@ -2563,11 +2565,8 @@ sexpr_to_xend_topology(virConnectPtr conn, int numCpus; nodeToCpu = sexpr_node(root, "node/node_to_cpu"); - if (nodeToCpu == NULL) { - virXendError(conn, VIR_ERR_INTERNAL_ERROR, - "%s", _("failed to parse topology information")); - return -1; - } + if (nodeToCpu == NULL) + return 0; /* no NUMA support */ numCpus = sexpr_int(root, "node/nr_cpus");