]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Add architecture checks to qemuDomainMachineIsVirt()
authorAndrea Bolognani <abologna@redhat.com>
Wed, 22 Jun 2016 16:55:37 +0000 (18:55 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 24 Jun 2016 08:17:59 +0000 (10:17 +0200)
Remove all external architecture checks that have been
made redundant by this change.

src/qemu/qemu_capabilities.c
src/qemu/qemu_command.c
src/qemu/qemu_domain.c

index 4ed5b71c50e654caaac79d442db00e036a442188..5fcd744b7c57993514650d4a2a4e78fee0ec68a5 100644 (file)
@@ -2174,13 +2174,11 @@ bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps,
         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;
 }
index 64b3664a9835e7de6b7426a029a859cdc44cfd6f..91f4e42e5863b3b16f6b9b142e0f625c565b5a0c 100644 (file)
@@ -6839,9 +6839,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
 
         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"));
index 4a5378f7372583c832f44054ca7159125193d784..d4438273abe0b5ae46307a0bb280ed0b44c395a8 100644 (file)
@@ -2041,7 +2041,6 @@ qemuDomainDefEnableDefaultFeatures(virDomainDefPtr def,
      * 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");
@@ -4920,8 +4919,15 @@ qemuDomainMachineIsS390CCW(const virDomainDef *def)
 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;
 }