qemuDomainNeedsFDC: Simplify and improve checking if a machine needs FDC

Commit c7f3a1f787 turned qemuDomainMachineNeedsFDC() effectively into
qemuDomainIsQ35. Use it instead as it also matches the non-canonicalized
'q35'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-01-05 09:51:22 +01:00
parent dc5fd559eb
commit 2168b584a8

View File

@ -8685,20 +8685,6 @@ bool qemuDomainHasBuiltinESP(const virDomainDef *def)
}
static bool
qemuDomainMachineNeedsFDC(const char *machine,
const virArch arch)
{
if (!ARCH_IS_X86(arch))
return false;
if (!STRPREFIX(machine, "pc-q35-"))
return false;
return true;
}
bool
qemuDomainIsQ35(const virDomainDef *def)
{
@ -8781,7 +8767,8 @@ qemuDomainHasBuiltinIDE(const virDomainDef *def)
bool
qemuDomainNeedsFDC(const virDomainDef *def)
{
return qemuDomainMachineNeedsFDC(def->os.machine, def->os.arch);
/* all supported Q35 machines need explicit FDC */
return qemuDomainIsQ35(def);
}