mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu_command.c: move QEMU_CAPS_FW_CFG validation to qemu_validate.c
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
f800aa3ee7
commit
2d8a60fab1
@ -5758,7 +5758,6 @@ qemuBuildSmbiosCommandLine(virCommandPtr cmd,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
qemuBuildSysinfoCommandLine(virCommandPtr cmd,
|
qemuBuildSysinfoCommandLine(virCommandPtr cmd,
|
||||||
virQEMUCapsPtr qemuCaps,
|
|
||||||
const virDomainDef *def)
|
const virDomainDef *def)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -5771,12 +5770,6 @@ qemuBuildSysinfoCommandLine(virCommandPtr cmd,
|
|||||||
if (def->sysinfo[i]->type != VIR_SYSINFO_FWCFG)
|
if (def->sysinfo[i]->type != VIR_SYSINFO_FWCFG)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_FW_CFG)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("fw_cfg is not supported with this QEMU"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (j = 0; j < def->sysinfo[i]->nfw_cfgs; j++) {
|
for (j = 0; j < def->sysinfo[i]->nfw_cfgs; j++) {
|
||||||
const virSysinfoFWCfgDef *f = &def->sysinfo[i]->fw_cfgs[j];
|
const virSysinfoFWCfgDef *f = &def->sysinfo[i]->fw_cfgs[j];
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
@ -9928,7 +9921,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
|
|||||||
if (qemuBuildSmbiosCommandLine(cmd, driver, def) < 0)
|
if (qemuBuildSmbiosCommandLine(cmd, driver, def) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (qemuBuildSysinfoCommandLine(cmd, qemuCaps, def) < 0)
|
if (qemuBuildSysinfoCommandLine(cmd, def) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (qemuBuildVMGenIDCommandLine(cmd, def) < 0)
|
if (qemuBuildVMGenIDCommandLine(cmd, def) < 0)
|
||||||
|
@ -778,10 +778,17 @@ qemuValidateDefGetVcpuHotplugGranularity(const virDomainDef *def)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
qemuValidateDomainDefSysinfo(const virSysinfoDef *def,
|
qemuValidateDomainDefSysinfo(const virSysinfoDef *def,
|
||||||
virQEMUCapsPtr qemuCaps G_GNUC_UNUSED)
|
virQEMUCapsPtr qemuCaps)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
if (def->type == VIR_SYSINFO_FWCFG &&
|
||||||
|
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_FW_CFG)) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("fw_cfg is not supported with this QEMU"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < def->nfw_cfgs; i++) {
|
for (i = 0; i < def->nfw_cfgs; i++) {
|
||||||
const virSysinfoFWCfgDef *f = &def->fw_cfgs[i];
|
const virSysinfoFWCfgDef *f = &def->fw_cfgs[i];
|
||||||
|
|
||||||
|
@ -1153,7 +1153,7 @@ mymain(void)
|
|||||||
QEMU_CAPS_DEVICE_IVSHMEM_PLAIN, QEMU_CAPS_DEVICE_IVSHMEM_DOORBELL);
|
QEMU_CAPS_DEVICE_IVSHMEM_PLAIN, QEMU_CAPS_DEVICE_IVSHMEM_DOORBELL);
|
||||||
DO_TEST("smbios", NONE);
|
DO_TEST("smbios", NONE);
|
||||||
DO_TEST("smbios-multiple-type2", NONE);
|
DO_TEST("smbios-multiple-type2", NONE);
|
||||||
DO_TEST("smbios-type-fwcfg", NONE);
|
DO_TEST("smbios-type-fwcfg", QEMU_CAPS_FW_CFG);
|
||||||
|
|
||||||
DO_TEST_CAPS_LATEST("os-firmware-bios");
|
DO_TEST_CAPS_LATEST("os-firmware-bios");
|
||||||
DO_TEST_CAPS_LATEST("os-firmware-efi");
|
DO_TEST_CAPS_LATEST("os-firmware-efi");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user