提交 94f6e2f9 编写于 作者: D Daniel Henrique Barboza 提交者: Cole Robinson

qemu: command: move validation of vmcoreinfo to qemu_domain.c

Move the validation of vmcoreinfo from qemuBuildVMCoreInfoCommandLine()
to qemuDomainDefValidateFeatures(), allowing for validation
at domain define time.

qemuxml2xmltest.c was changed to account for this caps being
now validated at this earlier stage.
Reviewed-by: NCole Robinson <crobinso@redhat.com>
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
上级 a15de75d
......@@ -9223,21 +9223,13 @@ qemuBuildSEVCommandLine(virDomainObjPtr vm, virCommandPtr cmd,
static int
qemuBuildVMCoreInfoCommandLine(virCommandPtr cmd,
const virDomainDef *def,
virQEMUCapsPtr qemuCaps)
const virDomainDef *def)
{
virTristateSwitch vmci = def->features[VIR_DOMAIN_FEATURE_VMCOREINFO];
if (vmci != VIR_TRISTATE_SWITCH_ON)
return 0;
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMCOREINFO)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("vmcoreinfo is not available "
"with this QEMU binary"));
return -1;
}
virCommandAddArgList(cmd, "-device", "vmcoreinfo", NULL);
return 0;
}
......@@ -9939,7 +9931,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
if (qemuBuildNVRAMCommandLine(cmd, def) < 0)
return NULL;
if (qemuBuildVMCoreInfoCommandLine(cmd, def, qemuCaps) < 0)
if (qemuBuildVMCoreInfoCommandLine(cmd, def) < 0)
return NULL;
if (qemuBuildSEVCommandLine(vm, cmd, def->sev) < 0)
......
......@@ -5149,6 +5149,16 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
}
break;
case VIR_DOMAIN_FEATURE_VMCOREINFO:
if (def->features[i] == VIR_TRISTATE_SWITCH_ON &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMCOREINFO)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("vmcoreinfo 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:
......@@ -5159,7 +5169,6 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
case VIR_DOMAIN_FEATURE_PVSPINLOCK:
case VIR_DOMAIN_FEATURE_CAPABILITIES:
case VIR_DOMAIN_FEATURE_PMU:
case VIR_DOMAIN_FEATURE_VMCOREINFO:
case VIR_DOMAIN_FEATURE_MSRS:
case VIR_DOMAIN_FEATURE_LAST:
break;
......
......@@ -1330,7 +1330,7 @@ mymain(void)
DO_TEST("cpu-check-default-none2", NONE);
DO_TEST("cpu-check-default-partial", NONE);
DO_TEST("cpu-check-default-partial2", NONE);
DO_TEST("vmcoreinfo", NONE);
DO_TEST("vmcoreinfo", QEMU_CAPS_DEVICE_VMCOREINFO);
DO_TEST("smartcard-host", QEMU_CAPS_CCID_EMULATED);
DO_TEST("smartcard-host-certificates", QEMU_CAPS_CCID_EMULATED);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册