On a Thursday in 2021, Peter Krempa wrote:
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.


One step closer to O(n log(n)) command-line generation.

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 <pkre...@redhat.com>
---
src/qemu/qemu_validate.c | 79 ++++++++++++++++++----------------------
1 file changed, 35 insertions(+), 44 deletions(-)


Reviewed-by: Ján Tomko <jto...@redhat.com>

Jano

Attachment: signature.asc
Description: PGP signature

Reply via email to