qemu_validate: Allow kvm hint-dedicated on non-passthrough VMs

A VM defined similar to:
  ...
  <features><kvm><hint-dedicated state='on'/></kvm></features>
  <cpu mode="host-model"/>
  ...
is currently invalid, as hint-dedicated is only allowed if cpu mode
is host-passthrough or maximum. This restriction is unnecessary, see
https://bugzilla.redhat.com/show_bug.cgi?id=1857671

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-02-19 10:54:00 +01:00 committed by Ján Tomko
parent b0f4cf25a6
commit c0ac0144a3

View File

@ -253,17 +253,6 @@ qemuValidateDomainDefFeatures(const virDomainDef *def,
}
break;
case VIR_DOMAIN_FEATURE_KVM:
if (def->kvm_features[VIR_DOMAIN_KVM_DEDICATED] == VIR_TRISTATE_SWITCH_ON &&
(!def->cpu || (def->cpu->mode != VIR_CPU_MODE_HOST_PASSTHROUGH &&
def->cpu->mode != VIR_CPU_MODE_MAXIMUM))) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("kvm-hint-dedicated=on is only applicable "
"for cpu host-passthrough / maximum"));
return -1;
}
break;
case VIR_DOMAIN_FEATURE_VMPORT:
if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
!virQEMUCapsSupportsVmport(qemuCaps, def)) {
@ -336,6 +325,7 @@ qemuValidateDomainDefFeatures(const virDomainDef *def,
}
break;
case VIR_DOMAIN_FEATURE_KVM:
case VIR_DOMAIN_FEATURE_XEN:
case VIR_DOMAIN_FEATURE_ACPI:
case VIR_DOMAIN_FEATURE_PAE: