mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
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: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
a15de75dc5
commit
94f6e2f9fc
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user