]> xenbits.xensource.com Git - libvirt.git/commit
conf: Add the cpu duplicate use check for vm numa settings
authorLuyao Huang <lhuang@redhat.com>
Tue, 5 May 2015 10:13:38 +0000 (18:13 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 5 May 2015 11:31:47 +0000 (13:31 +0200)
commit8fedbbdb67434a5e1c81c23dfb1f744843a74091
tree3a03659ee03461218c5cbbd4f8a2960f83e69870
parent608c95c76cee49fe98b913d1b7beb1d728b7ca99
conf: Add the cpu duplicate use check for vm numa settings

https://bugzilla.redhat.com/show_bug.cgi?id=1176020

We had a check for the vcpu count total number in <numa>
before, however this check is not good enough. There are
some examples:

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'/>

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'/>

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'/>

Add a check for numa cpus, check if duplicate use one cpu in more
than one cell.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/numa_conf.c