提交 28f79bb3 编写于 作者: D Daniel Henrique Barboza 提交者: Cole Robinson

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: NCole Robinson <crobinso@redhat.com>
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
上级 96178e22
...@@ -7097,17 +7097,9 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, ...@@ -7097,17 +7097,9 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
*/ */
virBufferAddLit(&buf, ",usb=off"); virBufferAddLit(&buf, ",usb=off");
if (vmport) { if (vmport != VIR_TRISTATE_SWITCH_ABSENT)
if (!virQEMUCapsSupportsVmport(qemuCaps, def)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("vmport is not available "
"with this QEMU binary"));
return -1;
}
virBufferAsprintf(&buf, ",vmport=%s", virBufferAsprintf(&buf, ",vmport=%s",
virTristateSwitchTypeToString(vmport)); virTristateSwitchTypeToString(vmport));
}
if (smm) if (smm)
virBufferAsprintf(&buf, ",smm=%s", virTristateSwitchTypeToString(smm)); virBufferAsprintf(&buf, ",smm=%s", virTristateSwitchTypeToString(smm));
......
...@@ -5114,6 +5114,17 @@ qemuDomainDefValidateFeatures(const virDomainDef *def, ...@@ -5114,6 +5114,17 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
} }
break; 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_ACPI:
case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_APIC:
case VIR_DOMAIN_FEATURE_PAE: case VIR_DOMAIN_FEATURE_PAE:
...@@ -5124,7 +5135,6 @@ qemuDomainDefValidateFeatures(const virDomainDef *def, ...@@ -5124,7 +5135,6 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
case VIR_DOMAIN_FEATURE_PVSPINLOCK: case VIR_DOMAIN_FEATURE_PVSPINLOCK:
case VIR_DOMAIN_FEATURE_CAPABILITIES: case VIR_DOMAIN_FEATURE_CAPABILITIES:
case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_PMU:
case VIR_DOMAIN_FEATURE_VMPORT:
case VIR_DOMAIN_FEATURE_VMCOREINFO: case VIR_DOMAIN_FEATURE_VMCOREINFO:
case VIR_DOMAIN_FEATURE_MSRS: case VIR_DOMAIN_FEATURE_MSRS:
case VIR_DOMAIN_FEATURE_LAST: case VIR_DOMAIN_FEATURE_LAST:
......
...@@ -840,7 +840,8 @@ mymain(void) ...@@ -840,7 +840,8 @@ mymain(void)
QEMU_CAPS_SPICE, QEMU_CAPS_SPICE,
QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_QXL,
QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_HDA_DUPLEX,
QEMU_CAPS_USB_REDIR); QEMU_CAPS_USB_REDIR,
QEMU_CAPS_MACHINE_VMPORT_OPT);
DO_TEST("pcie-root", DO_TEST("pcie-root",
QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_DEVICE_IOH3420,
QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_ICH9_AHCI,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册