[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 4/4] fixup! numa: add -numa node, memdev= option
From: |
Hu Tao |
Subject: |
[Qemu-devel] [PATCH v2 4/4] fixup! numa: add -numa node, memdev= option |
Date: |
Mon, 16 Jun 2014 18:05:44 +0800 |
note: this is a fixup that can be squashed into commit 0886aa7db0e4.
if numa node number doesn't start from 0 then qemu will core dump.
cmd line to reproduce:
./x86_64-softmmu/qemu-system-x86_64 -hda
/home/data/libvirt-images/f18.img -m 128M,maxmem=2G,slots=3 -qmp
unix:/tmp/m,server,nowait -monitor stdio -enable-kvm -object
memory-backend-ram,id=m1,size=128M -numa node,nodeid=1,cpus=1,memdev=m1
Signed-off-by: Hu Tao <address@hidden>
---
numa.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/numa.c b/numa.c
index bcbafd2..eef0717 100644
--- a/numa.c
+++ b/numa.c
@@ -266,10 +266,13 @@ void memory_region_allocate_system_memory(MemoryRegion
*mr, Object *owner,
}
memory_region_init(mr, owner, name, ram_size);
- for (i = 0; i < nb_numa_nodes; i++) {
+ for (i = 0; i < MAX_NODES; i++) {
Error *local_err = NULL;
uint64_t size = numa_info[i].node_mem;
HostMemoryBackend *backend = numa_info[i].node_memdev;
+ if (!backend) {
+ continue;
+ }
MemoryRegion *seg = host_memory_backend_get_memory(backend,
&local_err);
if (local_err) {
qerror_report_err(local_err);
--
1.9.3