]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Report error when default TPM version is provided
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 18 Jul 2022 07:55:08 +0000 (09:55 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 1 Aug 2022 15:35:48 +0000 (17:35 +0200)
commitd5712c54a6dc42e06e8c8679b3af59db75845116
tree3b474bfab1ed9d640b74b8e5f7210d51febf6d4c
parent3f7c63bba5fb2abd7caed71c79194e5200ec0a19
conf: Report error when default TPM version is provided

When "default" version of 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 qemuDomainDefTPMsPostParse()).

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