From 851c5f075b6c68ff5acd06694784b496171f2796 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 13 Jul 2023 10:29:11 +0200 Subject: [PATCH] qemu_domain: Deduplicate targetNode check in qemuDomainDefValidateMemoryHotplugDevice() If a domain has NUMA configured, then all devices (except for 'virtio-pmem') need to have targetNode set. There are two checks inside of qemuDomainDefValidateMemoryHotplugDevice() for this: one inside of big switch() statement, which only checks 'dimm' and 'nvdimm' cases, and the other at the end of the function that checks all models (except for 'virtio-pmem'). Let's keep the latter and remove the former as the latter covers the former too. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- src/qemu/qemu_domain.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 94587638c3..3700b3e711 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9189,15 +9189,6 @@ qemuDomainDefValidateMemoryHotplugDevice(const virDomainMemoryDef *mem, return -1; } - if (virDomainNumaGetNodeCount(def->numa) != 0) { - if (mem->targetNode == -1) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("target NUMA node needs to be specified for " - "memory device")); - return -1; - } - } - if (mem->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM) { if (mem->info.addr.dimm.slot >= def->mem.memory_slots) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED,