diff --git a/Add-Support-for-numa-being-initialized-with-mem-0-an.patch b/Add-Support-for-numa-being-initialized-with-mem-0-an.patch new file mode 100644 index 0000000000000000000000000000000000000000..886885f5dcfffff6d651f721f157151fbb0b34b5 --- /dev/null +++ b/Add-Support-for-numa-being-initialized-with-mem-0-an.patch @@ -0,0 +1,86 @@ +From 5988b5ba063a2172a6c6990e7492a795e7e5a246 Mon Sep 17 00:00:00 2001 +From: jiazhongfeng <14889146+jiazhongfeng@user.noreply.gitee.com> +Date: Thu, 17 Oct 2024 09:25:30 +0800 +Subject: [PATCH] Add Support for numa being initialized with mem 0 and memory + hot plug + +--- + backends/hostmem-file.c | 1 - + backends/hostmem.c | 9 +++------ + hw/core/machine.c | 5 ++++- + hw/core/numa.c | 4 ++++ + 4 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c +index cd038024fa..6be6d40541 100644 +--- a/backends/hostmem-file.c ++++ b/backends/hostmem-file.c +@@ -43,7 +43,6 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) + gchar *name; + + if (!backend->size) { +- error_setg(errp, "can't create backend with size 0"); + return; + } + if (!fb->mem_path) { +diff --git a/backends/hostmem.c b/backends/hostmem.c +index 4c05862ed5..46cf3855a9 100644 +--- a/backends/hostmem.c ++++ b/backends/hostmem.c +@@ -64,12 +64,6 @@ host_memory_backend_set_size(Object *obj, Visitor *v, const char *name, + if (!visit_type_size(v, name, &value, errp)) { + return; + } +- if (!value) { +- error_setg(errp, +- "property '%s' of %s doesn't take value '%" PRIu64 "'", +- name, object_get_typename(obj), value); +- return; +- } + backend->size = value; + } + +@@ -337,6 +331,9 @@ host_memory_backend_memory_complete(UserCreatable *uc, Error **errp) + goto out; + } + ++ if (0 == backend->size) { ++ return; ++ } + ptr = memory_region_get_ram_ptr(&backend->mr); + sz = memory_region_size(&backend->mr); + +diff --git a/hw/core/machine.c b/hw/core/machine.c +index 53a99abc56..d27ee4b30e 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -1084,7 +1084,10 @@ MemoryRegion *machine_consume_memdev(MachineState *machine, + HostMemoryBackend *backend) + { + MemoryRegion *ret = host_memory_backend_get_memory(backend); +- ++ if (NULL == ret) ++ { ++ return ret; ++ } + if (memory_region_is_mapped(ret)) { + error_report("memory backend %s can't be used multiple times.", + object_get_canonical_path_component(OBJECT(backend))); +diff --git a/hw/core/numa.c b/hw/core/numa.c +index e6050b2273..afe5644461 100644 +--- a/hw/core/numa.c ++++ b/hw/core/numa.c +@@ -629,6 +629,10 @@ static void numa_init_memdev_container(MachineState *ms, MemoryRegion *ram) + continue; + } + MemoryRegion *seg = machine_consume_memdev(ms, backend); ++ if (seg == NULL) ++ { ++ continue; ++ } + memory_region_add_subregion(ram, addr, seg); + addr += size; + } +-- +2.45.1.windows.1 + diff --git a/qemu.spec b/qemu.spec index 07c8cda9987a5bf77367a213940a287d6c67d2fa..bb5be08df95aecc7710c2902666a2d612c4b62e2 100644 --- a/qemu.spec +++ b/qemu.spec @@ -3,7 +3,7 @@ Name: qemu Version: 6.2.0 -Release: 101 +Release: 102 Epoch: 10 Summary: QEMU is a generic and open source machine emulator and virtualizer License: GPLv2 and BSD and MIT and CC-BY-SA-4.0 @@ -1070,6 +1070,7 @@ Patch1055: hw-i386-vmmouse-Require-i8042-property-to-be-set.patch Patch1056: vhost-backend-avoid-overflow-on-memslots_limit.patch Patch1057: sysemu-Cleanup-qemu_run_machine_init_done_notifiers.patch Patch1058: python-aqmp-use-absolute-import-statement.patch +Patch1059: Add-Support-for-numa-being-initialized-with-mem-0-an.patch BuildRequires: flex BuildRequires: gcc @@ -1668,6 +1669,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Oct 22 2024 - 10:6.2.0-102 +- Add Support for numa being initialized with mem 0 and memory + * Mon Oct 21 2024 - 10:6.2.0-101 - python/aqmp: use absolute import statement - sysemu: Cleanup qemu_run_machine_init_done_notifiers()