]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuValidateDomainDeviceDef: Optimize virDomainDeviceInfo validation
authorPeter Krempa <pkrempa@redhat.com>
Fri, 1 Oct 2021 15:06:27 +0000 (17:06 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 12 Oct 2021 08:26:02 +0000 (10:26 +0200)
commit68c80fcfe97c4643e0d230bc2aef0dbcf8d1fcd7
treea14bf2e2ac6dc28085e6a20dc95420383691806a
parent7a8694e5f396bbde27b323c1cd574a728539b56a
qemuValidateDomainDeviceDef: Optimize virDomainDeviceInfo validation

Commit ffda44030a2 added validation of the 'acpiIndex' field in
virDomainDeviceInfo by calling 'virDomainDeviceInfoIterate' from
'qemuValidateDomainDef'. This is overly complicated we have
'qemuValidateDomainDeviceDef' which is already called for every single
device so we can avoid the extra loop.

Restructure the code by calling 'qemuValidateDomainDeviceInfo' directly
from 'qemuValidateDomainDeviceDef' and avoid unnecessary calls to
'virDomainDeviceGetInfo' by calling 'qemuValidateDomainDeviceDefAddress'
from 'qemuValidateDomainDeviceInfo'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_validate.c