qemu/kvm: try dmidecode on all targets
authorAndrew Jones <drjones@redhat.com>
Tue, 27 Oct 2015 17:16:03 +0000 (18:16 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 20 Jun 2016 12:30:39 +0000 (08:30 -0400)
Looking at "$dmi" on targets that don't support dmidecode is
harmless. Furthermore it works, not only for arm targets, but
also pc, so move it out of the 'if arm' block.

Makefile.am
tests/qemu-smbios/proc/cpuinfo [moved from tests/qemu-arm-acpi/proc/cpuinfo with 100% similarity]
tests/qemu-smbios/proc/self/status [moved from tests/qemu-arm-acpi/proc/self/status with 100% similarity]
tests/qemu-smbios/sbin/dmidecode [moved from tests/qemu-arm-acpi/sbin/dmidecode with 100% similarity]
tests/qemu-smbios/sbin/uname [moved from tests/qemu-arm-acpi/sbin/uname with 100% similarity]
tests/qemu-smbios/sbin/virt-what-cpuid-helper [moved from tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper with 100% similarity]
tests/test-qemu-smbios.sh [moved from tests/test-qemu-arm-acpi.sh with 98% similarity]
virt-what.in

index 2c958ca..0045bcb 100644 (file)
@@ -53,7 +53,7 @@ TESTS = \
        tests/test-parallels-desktop.sh \
        tests/test-qemu.sh \
        tests/test-qemu-arm.sh \
-       tests/test-qemu-arm-acpi.sh \
+       tests/test-qemu-smbios.sh \
        tests/test-rhel5-xen-dom0.sh \
        tests/test-rhel5-xen-domU-hvm.sh \
        tests/test-rhel5-xen-domU-hvm-ia64.sh \
@@ -138,11 +138,11 @@ EXTRA_DIST = \
        tests/qemu-arm/sbin/dmidecode \
        tests/qemu-arm/sbin/uname \
        tests/qemu-arm/sbin/virt-what-cpuid-helper \
-       tests/qemu-arm-acpi/proc/cpuinfo \
-       tests/qemu-arm-acpi/proc/self/status \
-       tests/qemu-arm-acpi/sbin/dmidecode \
-       tests/qemu-arm-acpi/sbin/uname \
-       tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper \
+       tests/qemu-smbios/proc/cpuinfo \
+       tests/qemu-smbios/proc/self/status \
+       tests/qemu-smbios/sbin/dmidecode \
+       tests/qemu-smbios/sbin/uname \
+       tests/qemu-smbios/sbin/virt-what-cpuid-helper \
        tests/rhel5-xen-dom0/proc/cpuinfo \
        tests/rhel5-xen-dom0/proc/self/status \
        tests/rhel5-xen-dom0/proc/xen/balloon \
similarity index 98%
rename from tests/test-qemu-arm-acpi.sh
rename to tests/test-qemu-smbios.sh
index 64db9eb..114470a 100755 (executable)
@@ -15,7 +15,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-root=tests/qemu-arm-acpi
+root=tests/qemu-smbios
 
 output="$(./virt-what --test-root=$root 2>&1)"
 expected="qemu"
index 2c2e6ac..355e438 100644 (file)
@@ -262,6 +262,11 @@ fi
 if ! "$skip_qemu_kvm"; then
     if [ "$cpuid" = "KVMKVMKVM" ]; then
         echo kvm
+    elif echo "$dmi" | grep -q 'Manufacturer: QEMU'; then
+        # We don't have enough information to determine if we're
+        # using KVM acceleration or not.
+        echo qemu
+        skip_lkvm=true
     elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then
         if [ -d "${root}/proc/device-tree" ] &&
             ls "${root}/proc/device-tree" | grep -q "fw-cfg"; then
@@ -269,11 +274,6 @@ if ! "$skip_qemu_kvm"; then
             # using KVM acceleration or not.
             echo qemu
             skip_lkvm=true
-        elif echo "$dmi" | grep -q 'Manufacturer: QEMU'; then
-            # We don't have enough information to determine if we're
-            # using KVM acceleration or not.
-            echo qemu
-            skip_lkvm=true
         fi
     else
         # XXX This is known to fail for qemu with the explicit -cpu