]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: fix issue on virCPUDefCopy
authorThibaut Collet <thibaut.collet@6wind.com>
Thu, 21 May 2015 13:55:40 +0000 (15:55 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 22 May 2015 13:14:19 +0000 (15:14 +0200)
The cpu xml copy is incorrect: the memAccess field is not copied.
The lack of copy of this memAccess field can cause unexpected behaviour for live
migration when vhost user is used.

For example if guest has the following configuration:
....
<cpu>
<model>Westmere</model>
<topology sockets="1" cores="4" threads="1"/>
<numa>
<cell id='0' cpus='0-3' memory='2097152' memAccess='shared'/>
</numa>
</cpu>
....

The used configuration on the remote host in case of live migration is:
....
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Westmere</model>
    <topology sockets='1' cores='4' threads='1'/>
    <numa>
      <cell id='0' cpus='0-3' memory='2097152' unit='KiB'/>
    </numa>
  </cpu>
....

On the remote host the lack of memAccess info can cause unexpected error on the
qemu backend vhost user driver.

Fixes: def6b3598 ("docs, conf, schema: add support for shared memory mapping")
This issue is present only for libvirt1.2.9 to libvirt1.2.12
With patch 181742d43 ("conf: Move all NUMA configuration to virDomainNuma")
present since libvirt1.2.13 the problem does not exist anymore as NUMA
information are no more in the CPU configuration.

Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
src/conf/cpu_conf.c

index 3af0f443c1e5459c2749fe32bfdb71999bb245ac..dc3d422fa82b8421484fee977ba203bfb9d60bf9 100644 (file)
@@ -158,6 +158,7 @@ virCPUDefCopy(const virCPUDef *cpu)
 
         for (i = 0; i < cpu->ncells; i++) {
             copy->cells[i].mem = cpu->cells[i].mem;
+            copy->cells[i].memAccess = cpu->cells[i].memAccess;
 
             copy->cells[i].cpumask = virBitmapNewCopy(cpu->cells[i].cpumask);