mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: command: move I/O APIC validation to qemu_domain.c
Validation of MACHINE_KERNEL_IRQCHIP and MACHINE_KERNEL_IRQCHIP_SPLIT QEMU caps are now being done in qemuDomainDefValidateFeatures(). Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
28f79bb342
commit
2453950da6
@ -7191,20 +7191,8 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (def->features[VIR_DOMAIN_FEATURE_IOAPIC] != VIR_DOMAIN_IOAPIC_NONE) {
|
if (def->features[VIR_DOMAIN_FEATURE_IOAPIC] != VIR_DOMAIN_IOAPIC_NONE) {
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("I/O APIC tuning is not supported by this "
|
|
||||||
"QEMU binary"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
switch ((virDomainIOAPIC) def->features[VIR_DOMAIN_FEATURE_IOAPIC]) {
|
switch ((virDomainIOAPIC) def->features[VIR_DOMAIN_FEATURE_IOAPIC]) {
|
||||||
case VIR_DOMAIN_IOAPIC_QEMU:
|
case VIR_DOMAIN_IOAPIC_QEMU:
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("split I/O APIC is not supported by this "
|
|
||||||
"QEMU binary"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
virBufferAddLit(&buf, ",kernel_irqchip=split");
|
virBufferAddLit(&buf, ",kernel_irqchip=split");
|
||||||
break;
|
break;
|
||||||
case VIR_DOMAIN_IOAPIC_KVM:
|
case VIR_DOMAIN_IOAPIC_KVM:
|
||||||
|
@ -5062,8 +5062,8 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
|
|||||||
|
|
||||||
switch ((virDomainFeature) i) {
|
switch ((virDomainFeature) i) {
|
||||||
case VIR_DOMAIN_FEATURE_IOAPIC:
|
case VIR_DOMAIN_FEATURE_IOAPIC:
|
||||||
if (def->features[i] != VIR_DOMAIN_IOAPIC_NONE &&
|
if (def->features[i] != VIR_DOMAIN_IOAPIC_NONE) {
|
||||||
!ARCH_IS_X86(def->os.arch)) {
|
if (!ARCH_IS_X86(def->os.arch)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("The '%s' feature is not supported for "
|
_("The '%s' feature is not supported for "
|
||||||
"architecture '%s' or machine type '%s'"),
|
"architecture '%s' or machine type '%s'"),
|
||||||
@ -5072,6 +5072,30 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
|
|||||||
def->os.machine);
|
def->os.machine);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_KERNEL_IRQCHIP)) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("I/O APIC tuning is not supported by "
|
||||||
|
"this QEMU binary"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ((virDomainIOAPIC) def->features[i]) {
|
||||||
|
case VIR_DOMAIN_IOAPIC_QEMU:
|
||||||
|
if (!virQEMUCapsGet(qemuCaps,
|
||||||
|
QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT)) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("split I/O APIC is not supported by this "
|
||||||
|
"QEMU binary"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case VIR_DOMAIN_IOAPIC_KVM:
|
||||||
|
case VIR_DOMAIN_IOAPIC_NONE:
|
||||||
|
case VIR_DOMAIN_IOAPIC_LAST:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_FEATURE_HPT:
|
case VIR_DOMAIN_FEATURE_HPT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user