[libvirt] [PATCHv2]rework the check for the numa cpus

Luyao Huang lhuang at redhat.com
Wed Apr 22 12:34:54 UTC 2015


 V1 discussion:
 https://www.redhat.com/archives/libvir-list/2015-April/msg00919.html

 new for v2:
 remove 1/2 because no need introduce a new flag to avoid the broken
 introduced by the new check.

We introduce a check for numa cpu total count in 5f7b71,
But seems this check cannot work well. There are some scenarioes:

1. one of cpu id is out of maxvcpus, can set success(cpu count = 5 < 10):

<vcpu placement='static'>10</vcpu>
<cell id='0' cpus='0-3,100' memory='512000' unit='KiB'/>

the cpus '100' exceed maxvcpus, this setting is not valid (although qemu
do not output error).

2. use the same cpu in 2 cell, can set success(cpu count = 8 < 10):
<vcpu placement='static'>10</vcpu>
<cell id='0' cpus='0-3' memory='512000' unit='KiB'/>
<cell id='1' cpus='0-3' memory='512000' unit='KiB'/>

I guess nobody will use this setting if he really want use numa in his
vm. (qemu not output error, but we can find some interesting things in
vm, all cpus have bind in one numa node)

3. use the same cpu in 2 cell, cannot set success(cpu count = 11 > 10):
<vcpu placement='static'>10</vcpu>
<cell id='0' cpus='0-6' memory='512000' unit='KiB'/>
<cell id='1' cpus='0-3' memory='512000' unit='KiB'/>

No need forbid this scenario if scenario 2 is a 'valid' setting.

However add new check during parse xml will make vm has broken settings
disappear after update libvirtd, so possible solutions:

1. add new check when parse xml, i chose this way in this version.

2. add new check when start vm.
I think this is a configuration issue, so no need report it so late.

3. just remove this check and do not add new check... :)

Luyao Huang (1):
  conf: rework the cpu check for vm numa settings

 src/conf/domain_conf.c |  6 +-----
 src/conf/numa_conf.c   | 37 ++++++++++++++++++++++++++++++-------
 src/conf/numa_conf.h   |  2 +-
 3 files changed, 32 insertions(+), 13 deletions(-)

-- 
1.8.3.1




More information about the libvir-list mailing list