[PATCH v2 0/9] move checks from parse to validate callbacks

Michal Privoznik mprivozn at redhat.com
Tue Dec 8 10:22:36 UTC 2020


On 12/7/20 2:54 PM, Daniel Henrique Barboza wrote:
> Hi,
> 
> This is the respin of [1] after the reviews from Michal.
> Although we're pushing code to validate callbacks instead of
> post parse functions, the idea and motivation is still in line
> with [2].
> 
> 
> [1] https://www.redhat.com/archives/libvir-list/2020-November/msg01409.html
> [2] https://gitlab.com/libvirt/libvirt/-/issues/7
> 
> 
> Daniel Henrique Barboza (9):
>    domain_conf.c: move boot related timeouts check to validate callback
>    domain_conf.c: move primary video check to validate callback
>    domain_conf.c: move QXL attributes check to
>      virDomainVideoDefValidate()
>    domain_conf.c: move vendor, product and tray checks to validate
>      callback
>    domain_conf.c: move smartcard address check to validate callback
>    domain_conf.c: move blkio path check to validate callback
>    domain_conf.c: move virDomainPCIControllerOpts checks to validate
>      callback
>    domain_conf.c: move pci-root/pcie-root address check to validateCB
>    domain_conf.c: move idmapEntry checks to validate callback
> 
>   src/conf/domain_conf.c                        | 353 +++++++++++-------
>   tests/qemuxml2argvdata/pci-root-address.err   |   2 +-
>   .../pseries-default-phb-numa-node.err         |   2 +-
>   .../video-multiple-primaries.err              |   1 +
>   .../video-multiple-primaries.xml              |  32 ++
>   tests/qemuxml2argvtest.c                      |  14 +-
>   6 files changed, 268 insertions(+), 136 deletions(-)
>   create mode 100644 tests/qemuxml2argvdata/video-multiple-primaries.err
>   create mode 100644 tests/qemuxml2argvdata/video-multiple-primaries.xml
> 

Reviewed-by: Michal Privoznik <mprivozn at redhat.com>

But since we are splitting parsing and validation code can we use this 
chance and move validators out of domain_conf.c allowing it to be 
smaller in size?

Michal




More information about the libvir-list mailing list