
beth kon wrote:
[PATCH 1/2] - add capability to access free memory information on each NUMA cell.
+ +/* number of cells in the node will be saved for later use */ +int nbNodeCells; This should be static I think. + if (xenDaemonNodeGetInfo(conn, &nodeInfo)) { + /* BETH - not sure what would be the appropriate error type. should I add one for xend? */ + virXendError(conn, VIR_ERR_XEN_CALL, " cannot determine actual number of cells"); + return -1; + } It's certainly possible to add errors (to virterror) if none of the existing errors seem to fit. But in this case I think it looks OK. A bigger problem here is that I think the call to xenDaemonNodeGetInfo should happen inside xen_internal.c:xenHypervisorNodeGetCellsFreeMemory, something like this: xenHypervisorNodeGetCellsFreeMemory (virConnectPtr conn, ....) { static int nb_nodes = -1; if (nb_nodes == -1) { virNodeInfo info; if (xenDaemonNodeGetInfo (conn, &info) == -1) { ... (error) ... } nb_nodes = info->nodes; } ... } Note also the explicit test for == -1 The rest of the patch looks OK to me. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903