[libvirt] [PATCH] virCPUDefCopy forgot to copy NUMA topology

As a result of it, guest NUMA topology would be lost during migration. --- src/conf/cpu_conf.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 2882389..348299b 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -108,6 +108,27 @@ virCPUDefCopy(const virCPUDefPtr cpu) goto no_memory; } + if (cpu->ncells) { + if (VIR_ALLOC_N(copy->cells, cpu->ncells) < 0) + goto no_memory; + copy->ncells_max = copy->ncells = cpu->ncells; + + for (i = 0; i < cpu->ncells; i++) { + copy->cells[i].cellid = cpu->cells[i].cellid; + copy->cells[i].mem = cpu->cells[i].mem; + + if (VIR_ALLOC_N(copy->cells[i].cpumask, + VIR_DOMAIN_CPUMASK_LEN) < 0) + goto no_memory; + memcpy(copy->cells[i].cpumask, cpu->cells[i].cpumask, + VIR_DOMAIN_CPUMASK_LEN); + + if (!(copy->cells[i].cpustr = strdup(cpu->cells[i].cpustr))) + goto no_memory; + } + copy->cells_cpus = cpu->cells_cpus; + } + return copy; no_memory: -- 1.7.8.2

On 01/03/2012 07:22 AM, Jiri Denemark wrote:
As a result of it, guest NUMA topology would be lost during migration. --- src/conf/cpu_conf.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-)
ACK. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Tue, Jan 03, 2012 at 09:38:52 -0700, Eric Blake wrote:
On 01/03/2012 07:22 AM, Jiri Denemark wrote:
As a result of it, guest NUMA topology would be lost during migration. --- src/conf/cpu_conf.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-)
ACK.
Thanks, pushed. Jirka
participants (2)
-
Eric Blake
-
Jiri Denemark