ch: Demote error when CH driver fails to init

If the host doesn't have /dev/kvm nor /dev/mshv, i.e. CH driver
is unable to run any guests, then an error is reported. But the
usual thing to do here is print an info message into the logs and
return VIR_DRV_STATE_INIT_SKIPPED. It is a recoverable error
after all.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik 2024-03-08 15:12:15 +01:00
parent 0be6e26469
commit 1cc5d7df9a

View File

@ -893,9 +893,8 @@ static int chStateInitialize(bool privileged,
VIR_ARCH_NONE, VIR_DOMAIN_VIRT_KVM) && VIR_ARCH_NONE, VIR_DOMAIN_VIRT_KVM) &&
!virCapabilitiesDomainSupported(ch_driver->caps, -1, !virCapabilitiesDomainSupported(ch_driver->caps, -1,
VIR_ARCH_NONE, VIR_DOMAIN_VIRT_HYPERV)) { VIR_ARCH_NONE, VIR_DOMAIN_VIRT_HYPERV)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", VIR_INFO("/dev/kvm and /dev/mshv are missing. CH driver failed to initialize.");
_("/dev/kvm and /dev/mshv are missing. CH driver failed to initialize.")); return VIR_DRV_STATE_INIT_SKIPPED;
return VIR_DRV_STATE_INIT_ERROR;
} }
if (!(ch_driver->xmlopt = chDomainXMLConfInit(ch_driver))) if (!(ch_driver->xmlopt = chDomainXMLConfInit(ch_driver)))