return false;
}
- if (ARCH_IS_ARM(def->os.arch)) {
- /* If 'virt' supports PCI, it supports multibus.
- * No extra conditions here for simplicity.
- */
- if (qemuDomainMachineIsVirt(def))
- return true;
- }
+ /* If 'virt' supports PCI, it supports multibus.
+ * No extra conditions here for simplicity.
+ */
+ if (qemuDomainMachineIsVirt(def))
+ return true;
return false;
}
if (def->features[VIR_DOMAIN_FEATURE_GIC] == VIR_TRISTATE_SWITCH_ON) {
if (def->gic_version != VIR_GIC_VERSION_NONE) {
- if ((def->os.arch != VIR_ARCH_ARMV7L &&
- def->os.arch != VIR_ARCH_AARCH64) ||
- !qemuDomainMachineIsVirt(def)) {
+ if (!qemuDomainMachineIsVirt(def)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("gic-version option is available "
"only for ARM virt machine"));
* was not included in the domain XML, we need to choose a suitable
* GIC version ourselves */
if (def->features[VIR_DOMAIN_FEATURE_GIC] == VIR_TRISTATE_SWITCH_ABSENT &&
- (def->os.arch == VIR_ARCH_ARMV7L || def->os.arch == VIR_ARCH_AARCH64) &&
qemuDomainMachineIsVirt(def)) {
VIR_DEBUG("Looking for usable GIC version in domain capabilities");
bool
qemuDomainMachineIsVirt(const virDomainDef *def)
{
- return STREQ(def->os.machine, "virt") ||
- STRPREFIX(def->os.machine, "virt-");
+ if (def->os.arch != VIR_ARCH_ARMV7L &&
+ def->os.arch != VIR_ARCH_AARCH64)
+ return false;
+
+ if (STRNEQ(def->os.machine, "virt") &&
+ !STRPREFIX(def->os.machine, "virt-"))
+ return false;
+
+ return true;
}