[libvirt] [PATCH 4/4] libxl: implement virDomainGetNumaParameters

Jim Fehlig jfehlig at suse.com
Tue Jul 2 20:35:25 UTC 2013


On 07/02/2013 02:22 PM, Jim Fehlig wrote:
> On 06/28/2013 08:33 AM, Dario Faggioli wrote:
>> Although, having it depending on Xen >= 4.3 (by using the proper
>> libxl feature flag).
>>
>> Xen currently implements a NUMA placement policy which is basically
>> the same as the 'interleaved' policy of `numactl', although it can
>> be applied on a subset of the available nodes. We therefore hardcode
>> "interleave" as 'numa_mode', and we use the newly introduced libxl
>> interface to figure out what nodes a domain spans ('numa_nodeset').
>>
>> With this change, it is now possible to query the NUMA node
>> affinity of a running domain:
>>
>> [raistlin at Zhaman ~]$ sudo virsh --connect xen:/// list
>>   Id    Name                           State
>> ----------------------------------------------------
>>   23    F18_x64                        running
>>
>> [raistlin at Zhaman ~]$ sudo virsh --connect xen:/// numatune 23
>> numa_mode      : interleave
>> numa_nodeset   : 1
>>
>> Signed-off-by: Dario Faggioli <dario.faggioli at citrix.com>
>> ---
>>   src/libxl/libxl_driver.c |  138 ++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 138 insertions(+)
>>
>> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
>> index 53af609..9bd6d99 100644
>> --- a/src/libxl/libxl_driver.c
>> +++ b/src/libxl/libxl_driver.c
>> @@ -28,6 +28,7 @@
>>     #include <math.h>
>>   #include <libxl.h>
>> +#include <libxl_utils.h>
>>   #include <fcntl.h>
>>   #include <regex.h>
>>   @@ -4514,6 +4515,140 @@ libxlDomainSetSchedulerParameters(virDomainPtr dom, 
>> virTypedParameterPtr params,
>>       return libxlDomainSetSchedulerParametersFlags(dom, params, nparams, 0);
>>   }
>>   +/* NUMA node affinity information is available through libxl
>> + * starting from Xen 4.3. */
>> +#ifdef LIBXL_HAVE_DOMAIN_NODEAFFINITY
>> +
>> +/* Number of Xen NUMA parameters */
>> +#define LIBXL_NUMA_NPARAM 2
>
> Is there a similar definition in Xen?  E.g. would future changes to libxl 
> adding more parameters, but neglecting to update here, cause problems?

BTW, with cppi installed this fails 'make syntax-check'

preprocessor_indentation
cppi: src/libxl/libxl_driver.c: line 4523: not properly indented
maint.mk: incorrect preprocessor indentation
make: *** [sc_preprocessor_indentation] Error 1

Preprocessor nesting is indented as follows

#if ...
# define ...
# if ...
#  define ...
# endif
#endif

Regards,
Jim




More information about the libvir-list mailing list