From 9a5ce5cb29994d6a58ac3046ae59a9ccaf294fce Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Wed, 28 Nov 2018 16:48:41 +0100 Subject: [PATCH] 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: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_domain.c | 27 ++++++++++++++++----------- src/qemu/qemu_domain.h | 15 ++++++++++----- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index eeb8a8e9f1..f035e68251 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5243,7 +5243,7 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps, 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, diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e5463fc429..14a7a10d2a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9876,7 +9876,8 @@ qemuFindAgentConfig(virDomainDefPtr def) bool -qemuDomainMachineIsQ35(const char *machine) +qemuDomainMachineIsQ35(const char *machine, + const virArch arch ATTRIBUTE_UNUSED) { return (STRPREFIX(machine, "pc-q35-") || STREQ(machine, "q35")); @@ -9884,7 +9885,8 @@ qemuDomainMachineIsQ35(const char *machine) bool -qemuDomainMachineIsI440FX(const char *machine) +qemuDomainMachineIsI440FX(const char *machine, + const virArch arch ATTRIBUTE_UNUSED) { return (STREQ(machine, "pc") || STRPREFIX(machine, "pc-0.") || @@ -9895,7 +9897,8 @@ qemuDomainMachineIsI440FX(const char *machine) bool -qemuDomainMachineIsS390CCW(const char *machine) +qemuDomainMachineIsS390CCW(const char *machine, + const virArch arch ATTRIBUTE_UNUSED) { return STRPREFIX(machine, "s390-ccw"); } @@ -9949,9 +9952,10 @@ qemuDomainMachineIsPSeries(const char *machine, bool -qemuDomainMachineHasBuiltinIDE(const char *machine) +qemuDomainMachineHasBuiltinIDE(const char *machine, + const virArch arch) { - return qemuDomainMachineIsI440FX(machine) || + return qemuDomainMachineIsI440FX(machine, arch) || STREQ(machine, "malta") || STREQ(machine, "sun4u") || STREQ(machine, "g3beige"); @@ -9959,7 +9963,8 @@ qemuDomainMachineHasBuiltinIDE(const char *machine) bool -qemuDomainMachineNeedsFDC(const char *machine) +qemuDomainMachineNeedsFDC(const char *machine, + const virArch arch ATTRIBUTE_UNUSED) { const char *p = STRSKIP(machine, "pc-q35-"); @@ -9979,21 +9984,21 @@ qemuDomainMachineNeedsFDC(const char *machine) bool qemuDomainIsQ35(const virDomainDef *def) { - return qemuDomainMachineIsQ35(def->os.machine); + return qemuDomainMachineIsQ35(def->os.machine, def->os.arch); } bool qemuDomainIsI440FX(const virDomainDef *def) { - return qemuDomainMachineIsI440FX(def->os.machine); + return qemuDomainMachineIsI440FX(def->os.machine, def->os.arch); } bool 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) bool qemuDomainHasBuiltinIDE(const virDomainDef *def) { - return qemuDomainMachineHasBuiltinIDE(def->os.machine); + return qemuDomainMachineHasBuiltinIDE(def->os.machine, def->os.arch); } bool qemuDomainNeedsFDC(const virDomainDef *def) { - return qemuDomainMachineNeedsFDC(def->os.machine); + return qemuDomainMachineNeedsFDC(def->os.machine, def->os.arch); } diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 8a18720e3b..c0b8b07eb1 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -828,17 +828,22 @@ void qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def, virDomainChrDefPtr qemuFindAgentConfig(virDomainDefPtr def); -bool qemuDomainMachineIsQ35(const char *machine); -bool qemuDomainMachineIsI440FX(const char *machine); -bool qemuDomainMachineIsS390CCW(const char *machine); +bool qemuDomainMachineIsQ35(const char *machine, + const virArch arch); +bool qemuDomainMachineIsI440FX(const char *machine, + const virArch arch); +bool qemuDomainMachineIsS390CCW(const char *machine, + const virArch arch); bool qemuDomainMachineIsARMVirt(const char *machine, const virArch arch); bool qemuDomainMachineIsRISCVVirt(const char *machine, const virArch arch); bool qemuDomainMachineIsPSeries(const char *machine, const virArch arch); -bool qemuDomainMachineHasBuiltinIDE(const char *machine); -bool qemuDomainMachineNeedsFDC(const char *machine); +bool qemuDomainMachineHasBuiltinIDE(const char *machine, + const virArch arch); +bool qemuDomainMachineNeedsFDC(const char *machine, + const virArch arch); bool qemuDomainIsQ35(const virDomainDef *def); bool qemuDomainIsI440FX(const virDomainDef *def); -- GitLab