]> xenbits.xensource.com Git - libvirt.git/commit
virDomainDiskTranslateSourcePool: Fix check of 'startupPolicy' definition
authorPeter Krempa <pkrempa@redhat.com>
Tue, 14 Jun 2022 12:21:33 +0000 (14:21 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 14 Jun 2022 14:38:11 +0000 (16:38 +0200)
commited8984306e1cd44c424fda3ed412a4177dd7b84d
tree71dcbfd9493275a4b8b9cba609c630f16c7b1b98
parentb90d0f0a1e4ee52c828fb683c14c14e241e6fcbb
virDomainDiskTranslateSourcePool: Fix check of 'startupPolicy' definition

The check was historically done only for _TYPE_VOLUME disks, but
refactors to allow _TYPE_VOLUME disks in the backing chain caused a
regression where we'd reject startupPolicy also for _TYPE_BLOCK disks
which historically worked well.

Fix it by using the 'virDomainDiskDefValidateStartupPolicy' helper and
use it only when the top level image is a _TYPE_VOLUME as in other cases
it was already validated. This also allows _TYPE_BLOCK volumes to use
startup policy.

Fixes: 37f01262eed9f37dd5eb7de8b83edd2fea741054
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2095758
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_conf.c