]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_domain: Deduplicate targetNode check in qemuDomainDefValidateMemoryHotplugDevice()
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 13 Jul 2023 08:29:11 +0000 (10:29 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 13 Jul 2023 14:34:15 +0000 (16:34 +0200)
If a domain has NUMA configured, then all <memory/> 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 <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
src/qemu/qemu_domain.c

index 94587638c38dea0aaa3db2d430f4e0a70df0b1cd..3700b3e71170337ec6f5081e2aadb6464be6f1ff 100644 (file)
@@ -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,