提交 aa2da99e 编写于 作者: A Andrea Bolognani

qemu: Add arch checks to qemuDomainMachine*()

There is very little overlap in the machine types available
on different architectures, so broadly speaking checking the
machine type is usually enough; regardless, it's better to
check the architecture as well.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
上级 9a5ce5cb
......@@ -9877,8 +9877,11 @@ qemuFindAgentConfig(virDomainDefPtr def)
bool
qemuDomainMachineIsQ35(const char *machine,
const virArch arch ATTRIBUTE_UNUSED)
const virArch arch)
{
if (!ARCH_IS_X86(arch))
return false;
return (STRPREFIX(machine, "pc-q35-") ||
STREQ(machine, "q35"));
}
......@@ -9886,8 +9889,11 @@ qemuDomainMachineIsQ35(const char *machine,
bool
qemuDomainMachineIsI440FX(const char *machine,
const virArch arch ATTRIBUTE_UNUSED)
const virArch arch)
{
if (!ARCH_IS_X86(arch))
return false;
return (STREQ(machine, "pc") ||
STRPREFIX(machine, "pc-0.") ||
STRPREFIX(machine, "pc-1.") ||
......@@ -9898,8 +9904,11 @@ qemuDomainMachineIsI440FX(const char *machine,
bool
qemuDomainMachineIsS390CCW(const char *machine,
const virArch arch ATTRIBUTE_UNUSED)
const virArch arch)
{
if (!ARCH_IS_S390(arch))
return false;
return STRPREFIX(machine, "s390-ccw");
}
......@@ -9964,10 +9973,13 @@ qemuDomainMachineHasBuiltinIDE(const char *machine,
bool
qemuDomainMachineNeedsFDC(const char *machine,
const virArch arch ATTRIBUTE_UNUSED)
const virArch arch)
{
const char *p = STRSKIP(machine, "pc-q35-");
if (!ARCH_IS_X86(arch))
return false;
if (p) {
if (STRPREFIX(p, "1.") ||
STREQ(p, "2.0") ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册