]> xenbits.xensource.com Git - libvirt.git/commit
conf: Report an error when default TPM model is provided
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 18 Jul 2022 07:11:19 +0000 (09:11 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 1 Aug 2022 15:35:43 +0000 (17:35 +0200)
commit3f7c63bba5fb2abd7caed71c79194e5200ec0a19
treebc04c03575fe324b26d03c53b6206934b5a97c77
parentbad581466e88eee6390bd9680b4ad959d9ea59ed
conf: Report an error when default TPM model is provided

When "default" model of a TPM was provided, our parses accepts it
happily even though the value is forbidden by our RNG and not
documented as accepted value. This is because of < 0 vs <= 0
comparison of virDomainTPMModelTypeFromString() retval.

Make the parser error out explicitly in this case. Users can
always chose to not specify the attribute in which case we pick a
sane default (in qemuDomainTPMDefPostParse()).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h