mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
qemu: command: move validation of vmport to qemu_domain.c
virQEMUCapsSupportsVmport() is now being called inside qemuDomainDefValidateFeatures() for VIR_DOMAIN_FEATURE_VMPORT feature. qemuxml2xmltest.c was changed to account for this caps being now validated at domain define time. Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
96178e2238
commit
28f79bb342
@ -7097,17 +7097,9 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
|
||||
*/
|
||||
virBufferAddLit(&buf, ",usb=off");
|
||||
|
||||
if (vmport) {
|
||||
if (!virQEMUCapsSupportsVmport(qemuCaps, def)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("vmport is not available "
|
||||
"with this QEMU binary"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (vmport != VIR_TRISTATE_SWITCH_ABSENT)
|
||||
virBufferAsprintf(&buf, ",vmport=%s",
|
||||
virTristateSwitchTypeToString(vmport));
|
||||
}
|
||||
|
||||
if (smm)
|
||||
virBufferAsprintf(&buf, ",smm=%s", virTristateSwitchTypeToString(smm));
|
||||
|
@ -5114,6 +5114,17 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
|
||||
}
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_FEATURE_VMPORT:
|
||||
if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
|
||||
!virQEMUCapsSupportsVmport(qemuCaps, def)) {
|
||||
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("vmport is not available "
|
||||
"with this QEMU binary"));
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_FEATURE_ACPI:
|
||||
case VIR_DOMAIN_FEATURE_APIC:
|
||||
case VIR_DOMAIN_FEATURE_PAE:
|
||||
@ -5124,7 +5135,6 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
|
||||
case VIR_DOMAIN_FEATURE_PVSPINLOCK:
|
||||
case VIR_DOMAIN_FEATURE_CAPABILITIES:
|
||||
case VIR_DOMAIN_FEATURE_PMU:
|
||||
case VIR_DOMAIN_FEATURE_VMPORT:
|
||||
case VIR_DOMAIN_FEATURE_VMCOREINFO:
|
||||
case VIR_DOMAIN_FEATURE_MSRS:
|
||||
case VIR_DOMAIN_FEATURE_LAST:
|
||||
|
@ -840,7 +840,8 @@ mymain(void)
|
||||
QEMU_CAPS_SPICE,
|
||||
QEMU_CAPS_DEVICE_QXL,
|
||||
QEMU_CAPS_HDA_DUPLEX,
|
||||
QEMU_CAPS_USB_REDIR);
|
||||
QEMU_CAPS_USB_REDIR,
|
||||
QEMU_CAPS_MACHINE_VMPORT_OPT);
|
||||
DO_TEST("pcie-root",
|
||||
QEMU_CAPS_DEVICE_IOH3420,
|
||||
QEMU_CAPS_ICH9_AHCI,
|
||||
|
Loading…
Reference in New Issue
Block a user