[PATCH 050/103] qemuValidateDomainDeviceDef: Optimize virDomainDeviceInfo validation

Ján Tomko jtomko at redhat.com
Thu Oct 7 18:42:38 UTC 2021


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

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20211007/822a111a/attachment-0001.sig>


More information about the libvir-list mailing list