]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Validate virDomainMemoryDef::targetNode
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 26 Jul 2022 17:27:06 +0000 (19:27 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 1 Aug 2022 08:36:15 +0000 (10:36 +0200)
commitf7baee531ac10b07914ecd04cb0e4de0d2d10a2b
tree25ccb1f56b4e465da93deb513f93bb40684d041a
parent303636e7d049637a14f1ae41c53e9871ec8f23dc
conf: Validate virDomainMemoryDef::targetNode

Almost all of memory models we currently support allow setting
virDomainMemoryDef::targetNode so that the memory module is
associated with given guest NUMA node. And we do have a check
whether the requested node is within bounds, but it's executed
only when building QEMU's cmd line. Move it into validation
phase.

While this commit is moving the validation to a place that does
not validate all the possible code paths, it's okay, because only
the explicit memory device has user-configurable target node
which could break the assumption.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/domain_validate.c
src/qemu/qemu_command.c
tests/qemuxml2argvdata/memory-hotplug-invalid-targetnode.err [new file with mode: 0644]
tests/qemuxml2argvdata/memory-hotplug-invalid-targetnode.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c