提交 9a5ce5cb 编写于 作者: A Andrea Bolognani

qemu: Add arch parameter to qemuDomainMachine*()

We want the signatures to be consistent, and also we're
going to start using the additional parameter next.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
上级 4028d7a4
...@@ -5243,7 +5243,7 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps, ...@@ -5243,7 +5243,7 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps,
VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_FDC); VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_FDC);
} }
if (qemuDomainMachineHasBuiltinIDE(machine)) if (qemuDomainMachineHasBuiltinIDE(machine, qemuCaps->arch))
VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_IDE); VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_IDE);
VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_CAPS_ENUM_SET(disk->bus,
......
...@@ -9876,7 +9876,8 @@ qemuFindAgentConfig(virDomainDefPtr def) ...@@ -9876,7 +9876,8 @@ qemuFindAgentConfig(virDomainDefPtr def)
bool bool
qemuDomainMachineIsQ35(const char *machine) qemuDomainMachineIsQ35(const char *machine,
const virArch arch ATTRIBUTE_UNUSED)
{ {
return (STRPREFIX(machine, "pc-q35-") || return (STRPREFIX(machine, "pc-q35-") ||
STREQ(machine, "q35")); STREQ(machine, "q35"));
...@@ -9884,7 +9885,8 @@ qemuDomainMachineIsQ35(const char *machine) ...@@ -9884,7 +9885,8 @@ qemuDomainMachineIsQ35(const char *machine)
bool bool
qemuDomainMachineIsI440FX(const char *machine) qemuDomainMachineIsI440FX(const char *machine,
const virArch arch ATTRIBUTE_UNUSED)
{ {
return (STREQ(machine, "pc") || return (STREQ(machine, "pc") ||
STRPREFIX(machine, "pc-0.") || STRPREFIX(machine, "pc-0.") ||
...@@ -9895,7 +9897,8 @@ qemuDomainMachineIsI440FX(const char *machine) ...@@ -9895,7 +9897,8 @@ qemuDomainMachineIsI440FX(const char *machine)
bool bool
qemuDomainMachineIsS390CCW(const char *machine) qemuDomainMachineIsS390CCW(const char *machine,
const virArch arch ATTRIBUTE_UNUSED)
{ {
return STRPREFIX(machine, "s390-ccw"); return STRPREFIX(machine, "s390-ccw");
} }
...@@ -9949,9 +9952,10 @@ qemuDomainMachineIsPSeries(const char *machine, ...@@ -9949,9 +9952,10 @@ qemuDomainMachineIsPSeries(const char *machine,
bool bool
qemuDomainMachineHasBuiltinIDE(const char *machine) qemuDomainMachineHasBuiltinIDE(const char *machine,
const virArch arch)
{ {
return qemuDomainMachineIsI440FX(machine) || return qemuDomainMachineIsI440FX(machine, arch) ||
STREQ(machine, "malta") || STREQ(machine, "malta") ||
STREQ(machine, "sun4u") || STREQ(machine, "sun4u") ||
STREQ(machine, "g3beige"); STREQ(machine, "g3beige");
...@@ -9959,7 +9963,8 @@ qemuDomainMachineHasBuiltinIDE(const char *machine) ...@@ -9959,7 +9963,8 @@ qemuDomainMachineHasBuiltinIDE(const char *machine)
bool bool
qemuDomainMachineNeedsFDC(const char *machine) qemuDomainMachineNeedsFDC(const char *machine,
const virArch arch ATTRIBUTE_UNUSED)
{ {
const char *p = STRSKIP(machine, "pc-q35-"); const char *p = STRSKIP(machine, "pc-q35-");
...@@ -9979,21 +9984,21 @@ qemuDomainMachineNeedsFDC(const char *machine) ...@@ -9979,21 +9984,21 @@ qemuDomainMachineNeedsFDC(const char *machine)
bool bool
qemuDomainIsQ35(const virDomainDef *def) qemuDomainIsQ35(const virDomainDef *def)
{ {
return qemuDomainMachineIsQ35(def->os.machine); return qemuDomainMachineIsQ35(def->os.machine, def->os.arch);
} }
bool bool
qemuDomainIsI440FX(const virDomainDef *def) qemuDomainIsI440FX(const virDomainDef *def)
{ {
return qemuDomainMachineIsI440FX(def->os.machine); return qemuDomainMachineIsI440FX(def->os.machine, def->os.arch);
} }
bool bool
qemuDomainIsS390CCW(const virDomainDef *def) qemuDomainIsS390CCW(const virDomainDef *def)
{ {
return qemuDomainMachineIsS390CCW(def->os.machine); return qemuDomainMachineIsS390CCW(def->os.machine, def->os.arch);
} }
...@@ -10051,14 +10056,14 @@ qemuDomainHasPCIeRoot(const virDomainDef *def) ...@@ -10051,14 +10056,14 @@ qemuDomainHasPCIeRoot(const virDomainDef *def)
bool bool
qemuDomainHasBuiltinIDE(const virDomainDef *def) qemuDomainHasBuiltinIDE(const virDomainDef *def)
{ {
return qemuDomainMachineHasBuiltinIDE(def->os.machine); return qemuDomainMachineHasBuiltinIDE(def->os.machine, def->os.arch);
} }
bool bool
qemuDomainNeedsFDC(const virDomainDef *def) qemuDomainNeedsFDC(const virDomainDef *def)
{ {
return qemuDomainMachineNeedsFDC(def->os.machine); return qemuDomainMachineNeedsFDC(def->os.machine, def->os.arch);
} }
......
...@@ -828,17 +828,22 @@ void qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def, ...@@ -828,17 +828,22 @@ void qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def,
virDomainChrDefPtr qemuFindAgentConfig(virDomainDefPtr def); virDomainChrDefPtr qemuFindAgentConfig(virDomainDefPtr def);
bool qemuDomainMachineIsQ35(const char *machine); bool qemuDomainMachineIsQ35(const char *machine,
bool qemuDomainMachineIsI440FX(const char *machine); const virArch arch);
bool qemuDomainMachineIsS390CCW(const char *machine); bool qemuDomainMachineIsI440FX(const char *machine,
const virArch arch);
bool qemuDomainMachineIsS390CCW(const char *machine,
const virArch arch);
bool qemuDomainMachineIsARMVirt(const char *machine, bool qemuDomainMachineIsARMVirt(const char *machine,
const virArch arch); const virArch arch);
bool qemuDomainMachineIsRISCVVirt(const char *machine, bool qemuDomainMachineIsRISCVVirt(const char *machine,
const virArch arch); const virArch arch);
bool qemuDomainMachineIsPSeries(const char *machine, bool qemuDomainMachineIsPSeries(const char *machine,
const virArch arch); const virArch arch);
bool qemuDomainMachineHasBuiltinIDE(const char *machine); bool qemuDomainMachineHasBuiltinIDE(const char *machine,
bool qemuDomainMachineNeedsFDC(const char *machine); const virArch arch);
bool qemuDomainMachineNeedsFDC(const char *machine,
const virArch arch);
bool qemuDomainIsQ35(const virDomainDef *def); bool qemuDomainIsQ35(const virDomainDef *def);
bool qemuDomainIsI440FX(const virDomainDef *def); bool qemuDomainIsI440FX(const virDomainDef *def);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册