From f83e654c1bd16be6f4ca6a9b9f0606e86a74fa14 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:14:26 +0000 Subject: import virt-what-1.13-8.el7 --- diff --git a/SOURCES/0001-Differentiate-between-vserver-host-and-guest.patch b/SOURCES/0001-Differentiate-between-vserver-host-and-guest.patch index 38c34ef..3b472f5 100644 --- a/SOURCES/0001-Differentiate-between-vserver-host-and-guest.patch +++ b/SOURCES/0001-Differentiate-between-vserver-host-and-guest.patch @@ -1,7 +1,7 @@ From d409914d13b88541402fe871d70e3dff9d738455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 2 Sep 2013 15:24:11 +0100 -Subject: [PATCH 1/2] Differentiate between vserver host and guest. +Subject: [PATCH 01/26] Differentiate between vserver host and guest. RWMJ: Update documentation and tests. --- diff --git a/SOURCES/0001-Fix-various-typos-and-mistakes-in-comments.patch b/SOURCES/0001-Fix-various-typos-and-mistakes-in-comments.patch deleted file mode 100644 index 58a680f..0000000 --- a/SOURCES/0001-Fix-various-typos-and-mistakes-in-comments.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 9709c8f01ec3e2f78bcaa07045343de249d7618d Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 12 Dec 2013 08:47:37 +0000 -Subject: [PATCH 01/16] Fix various typos and mistakes in comments. - -(Thanks Robert P. J. Day) ---- - virt-what.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/virt-what.in b/virt-what.in -index 4b6d3b8..fb399be 100644 ---- a/virt-what.in -+++ b/virt-what.in -@@ -18,13 +18,13 @@ - - # 'virt-what' tries to detect the type of virtualization being - # used (or none at all if we're running on bare-metal). It prints --# out one of more lines each being a 'fact' about the virtualization. -+# out one or more lines each being a 'fact' about the virtualization. - # - # Please see also the manual page virt-what(1). - # This script should be run as root. - # - # The following resources were useful in writing this script: --# . http://www.dmo.ca/blog/20080530151107 -+# . http://dmo.ca/blog/detecting-virtualization-on-linux/ - - # Do not allow unset variables, and set defaults. - set -u -@@ -67,7 +67,7 @@ while true; do - done - - # Add /sbin and /usr/sbin to the path so we can find system --# binaries like dmicode. -+# binaries like dmidecode. - # Add /usr/libexec to the path so we can find the helper binary. - prefix=@prefix@ - exec_prefix=@exec_prefix@ --- -2.3.1 - diff --git a/SOURCES/0001-xen-Don-t-emit-warning-message-if-proc-xen-capabilit.patch b/SOURCES/0001-xen-Don-t-emit-warning-message-if-proc-xen-capabilit.patch deleted file mode 100644 index 456c96b..0000000 --- a/SOURCES/0001-xen-Don-t-emit-warning-message-if-proc-xen-capabilit.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 8709c0e87dc3124b1a64d85654d6d4904702d767 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 28 Oct 2013 11:09:24 +0000 -Subject: [PATCH] xen: Don't emit warning message if /proc/xen/capabilities - file does not exist. - -On Amazon EC2: - -xen -grep: /proc/xen/capabilities: No such file or directory -xen-domU - -The warning is harmless but should not be printed. - -Thanks: Can Zhang for testing. ---- - virt-what.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/virt-what.in b/virt-what.in -index bf663aa..4b6d3b8 100644 ---- a/virt-what.in -+++ b/virt-what.in -@@ -199,7 +199,7 @@ if [ "$cpuid" = "XenVMMXenVMM" ]; then - skip_qemu_kvm=true - elif [ -d "${root}/proc/xen" ]; then - echo xen -- if grep -q "control_d" "${root}/proc/xen/capabilities"; then -+ if grep -q "control_d" "${root}/proc/xen/capabilities" 2>/dev/null; then - echo xen-dom0 - else - echo xen-domU --- -1.8.3.1 - diff --git a/SOURCES/0002-Detect-new-Xen-VMs-RHBZ-973663.patch b/SOURCES/0002-Detect-new-Xen-VMs-RHBZ-973663.patch index a161b63..9bb52cd 100644 --- a/SOURCES/0002-Detect-new-Xen-VMs-RHBZ-973663.patch +++ b/SOURCES/0002-Detect-new-Xen-VMs-RHBZ-973663.patch @@ -1,7 +1,7 @@ From acd6bec92a99550ad98011d44f6381fdf7fa5992 Mon Sep 17 00:00:00 2001 From: nodata Date: Mon, 2 Sep 2013 16:59:32 +0100 -Subject: [PATCH 2/2] Detect new Xen VMs (RHBZ#973663). +Subject: [PATCH 02/26] Detect new Xen VMs (RHBZ#973663). --- virt-what.in | 2 +- diff --git a/SOURCES/0003-Fix-spelling-mistake-in-the-man-page-RHBZ-1099289.patch b/SOURCES/0003-Fix-spelling-mistake-in-the-man-page-RHBZ-1099289.patch deleted file mode 100644 index e83f1d9..0000000 --- a/SOURCES/0003-Fix-spelling-mistake-in-the-man-page-RHBZ-1099289.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 1efaa88391668a73d3c2c0cd96dfb5103ecf3975 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 20 May 2014 10:50:39 +0100 -Subject: [PATCH 03/16] Fix spelling mistake in the man page (RHBZ#1099289). - ---- - virt-what.pod | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/virt-what.pod b/virt-what.pod -index bff2998..bcafd26 100644 ---- a/virt-what.pod -+++ b/virt-what.pod -@@ -113,7 +113,7 @@ Status: contributed by Justin Clift - - The guest is running inside IBM PowerVM Lx86 Linux/x86 emulator. - --Status: data originally supplied by Jeffrey Scheel, confimed by -+Status: data originally supplied by Jeffrey Scheel, confirmed by - Yufang Zhang and RWMJ - - =item B --- -2.3.1 - diff --git a/SOURCES/0003-xen-Don-t-emit-warning-message-if-proc-xen-capabilit.patch b/SOURCES/0003-xen-Don-t-emit-warning-message-if-proc-xen-capabilit.patch new file mode 100644 index 0000000..8269fb0 --- /dev/null +++ b/SOURCES/0003-xen-Don-t-emit-warning-message-if-proc-xen-capabilit.patch @@ -0,0 +1,35 @@ +From 8709c0e87dc3124b1a64d85654d6d4904702d767 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 28 Oct 2013 11:09:24 +0000 +Subject: [PATCH 03/26] xen: Don't emit warning message if + /proc/xen/capabilities file does not exist. + +On Amazon EC2: + +xen +grep: /proc/xen/capabilities: No such file or directory +xen-domU + +The warning is harmless but should not be printed. + +Thanks: Can Zhang for testing. +--- + virt-what.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/virt-what.in b/virt-what.in +index bf663aa..4b6d3b8 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -199,7 +199,7 @@ if [ "$cpuid" = "XenVMMXenVMM" ]; then + skip_qemu_kvm=true + elif [ -d "${root}/proc/xen" ]; then + echo xen +- if grep -q "control_d" "${root}/proc/xen/capabilities"; then ++ if grep -q "control_d" "${root}/proc/xen/capabilities" 2>/dev/null; then + echo xen-dom0 + else + echo xen-domU +-- +1.8.3.1 + diff --git a/SOURCES/0004-Added-check-and-test-routines-for-Docker.patch b/SOURCES/0004-Added-check-and-test-routines-for-Docker.patch deleted file mode 100644 index 47a41bd..0000000 --- a/SOURCES/0004-Added-check-and-test-routines-for-Docker.patch +++ /dev/null @@ -1,142 +0,0 @@ -From abd067c4760640e232203689b4d32eacafdbbdde Mon Sep 17 00:00:00 2001 -From: Charles Nguyen -Date: Sat, 21 Jun 2014 22:27:51 -0500 -Subject: [PATCH 04/16] Added check and test routines for Docker - ---- - Makefile.am | 7 +++++++ - tests/docker/.dockerinit | 0 - tests/docker/proc/cpuinfo | 0 - tests/docker/proc/self/status | 0 - tests/docker/sbin/dmidecode | 6 ++++++ - tests/docker/sbin/uname | 2 ++ - tests/docker/sbin/virt-what-cpuid-helper | 2 ++ - tests/test-docker.sh | 34 ++++++++++++++++++++++++++++++++ - virt-what.in | 5 +++++ - 9 files changed, 56 insertions(+) - create mode 100644 tests/docker/.dockerinit - create mode 100644 tests/docker/proc/cpuinfo - create mode 100644 tests/docker/proc/self/status - create mode 100755 tests/docker/sbin/dmidecode - create mode 100755 tests/docker/sbin/uname - create mode 100755 tests/docker/sbin/virt-what-cpuid-helper - create mode 100755 tests/test-docker.sh - -diff --git a/Makefile.am b/Makefile.am -index 784d6db..24d1730 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -40,6 +40,7 @@ endif - - TESTS = \ - tests/test-baremetal.sh \ -+ tests/test-docker.sh \ - tests/test-esx4.1.sh \ - tests/test-hyperv.sh \ - tests/test-kvm.sh \ -@@ -63,6 +64,12 @@ EXTRA_DIST = \ - tests/baremetal/sbin/dmidecode \ - tests/baremetal/sbin/uname \ - tests/baremetal/sbin/virt-what-cpuid-helper \ -+ tests/docker/.dockerinit \ -+ tests/docker/proc/cpuinfo \ -+ tests/docker/proc/self/status \ -+ tests/docker/sbin/dmidecode \ -+ tests/docker/sbin/uname \ -+ tests/docker/sbin/virt-what-cpuid-helper \ - tests/esx4.1/proc/cpuinfo \ - tests/esx4.1/proc/self/status \ - tests/esx4.1/sbin/dmidecode \ -diff --git a/tests/docker/.dockerinit b/tests/docker/.dockerinit -new file mode 100644 -index 0000000..e69de29 -diff --git a/tests/docker/proc/cpuinfo b/tests/docker/proc/cpuinfo -new file mode 100644 -index 0000000..e69de29 -diff --git a/tests/docker/proc/self/status b/tests/docker/proc/self/status -new file mode 100644 -index 0000000..e69de29 -diff --git a/tests/docker/sbin/dmidecode b/tests/docker/sbin/dmidecode -new file mode 100755 -index 0000000..d9992ad ---- /dev/null -+++ b/tests/docker/sbin/dmidecode -@@ -0,0 +1,6 @@ -+#!/bin/sh - -+cat <<'EOF' -+# dmidecode 2.11 -+/dev/mem: Operation not permitted -+EOF -+exit 1 -diff --git a/tests/docker/sbin/uname b/tests/docker/sbin/uname -new file mode 100755 -index 0000000..ab0ec89 ---- /dev/null -+++ b/tests/docker/sbin/uname -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+echo x86_64 -diff --git a/tests/docker/sbin/virt-what-cpuid-helper b/tests/docker/sbin/virt-what-cpuid-helper -new file mode 100755 -index 0000000..ad82504 ---- /dev/null -+++ b/tests/docker/sbin/virt-what-cpuid-helper -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+echo @ -diff --git a/tests/test-docker.sh b/tests/test-docker.sh -new file mode 100755 -index 0000000..4187f61 ---- /dev/null -+++ b/tests/test-docker.sh -@@ -0,0 +1,34 @@ -+# Test for Docker -+# Copyright (C) 2008-2011 Red Hat Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+root=tests/docker -+ -+output="$(./virt-what --test-root=$root 2>&1)" -+expected="docker" -+ -+if [ "$output" != "$expected" ]; then -+ echo "$0: test failed because output did not match expected" -+ echo "Expected output was:" -+ echo "----------------------------------------" -+ echo "$expected" -+ echo "----------------------------------------" -+ echo "But the actual output of the program was:" -+ echo "----------------------------------------" -+ echo "$output" -+ echo "----------------------------------------" -+ exit 1 -+fi -diff --git a/virt-what.in b/virt-what.in -index fb399be..c04203e 100644 ---- a/virt-what.in -+++ b/virt-what.in -@@ -248,3 +248,8 @@ if ! "$skip_qemu_kvm"; then - fi - fi - fi -+ -+# Check for Docker. -+if [ -f "${root}/.dockerinit" ]; then -+ echo docker -+fi --- -2.3.1 - diff --git a/SOURCES/0004-Fix-various-typos-and-mistakes-in-comments.patch b/SOURCES/0004-Fix-various-typos-and-mistakes-in-comments.patch new file mode 100644 index 0000000..eeeabf7 --- /dev/null +++ b/SOURCES/0004-Fix-various-typos-and-mistakes-in-comments.patch @@ -0,0 +1,42 @@ +From 9709c8f01ec3e2f78bcaa07045343de249d7618d Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 12 Dec 2013 08:47:37 +0000 +Subject: [PATCH 04/26] Fix various typos and mistakes in comments. + +(Thanks Robert P. J. Day) +--- + virt-what.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/virt-what.in b/virt-what.in +index 4b6d3b8..fb399be 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -18,13 +18,13 @@ + + # 'virt-what' tries to detect the type of virtualization being + # used (or none at all if we're running on bare-metal). It prints +-# out one of more lines each being a 'fact' about the virtualization. ++# out one or more lines each being a 'fact' about the virtualization. + # + # Please see also the manual page virt-what(1). + # This script should be run as root. + # + # The following resources were useful in writing this script: +-# . http://www.dmo.ca/blog/20080530151107 ++# . http://dmo.ca/blog/detecting-virtualization-on-linux/ + + # Do not allow unset variables, and set defaults. + set -u +@@ -67,7 +67,7 @@ while true; do + done + + # Add /sbin and /usr/sbin to the path so we can find system +-# binaries like dmicode. ++# binaries like dmidecode. + # Add /usr/libexec to the path so we can find the helper binary. + prefix=@prefix@ + exec_prefix=@exec_prefix@ +-- +1.8.3.1 + diff --git a/SOURCES/0005-Added-documentation-for-Docker-tests.patch b/SOURCES/0005-Added-documentation-for-Docker-tests.patch deleted file mode 100644 index 7ef42b5..0000000 --- a/SOURCES/0005-Added-documentation-for-Docker-tests.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 902276acb3c0f92fc08c618cbbba18e9bee5a38f Mon Sep 17 00:00:00 2001 -From: Charles Nguyen -Date: Sat, 21 Jun 2014 23:43:05 -0500 -Subject: [PATCH 05/16] Added documentation for Docker tests - ---- - virt-what.pod | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/virt-what.pod b/virt-what.pod -index bcafd26..8fd9bc4 100644 ---- a/virt-what.pod -+++ b/virt-what.pod -@@ -25,6 +25,12 @@ don't know about or cannot detect. - - =over 4 - -+=item B -+ -+This is a Docker container. -+ -+Status: confirmed by Charles Nguyen -+ - =item B - - This is Microsoft Hyper-V hypervisor. --- -2.3.1 - diff --git a/SOURCES/0005-Fix-spelling-mistake-in-the-man-page-RHBZ-1099289.patch b/SOURCES/0005-Fix-spelling-mistake-in-the-man-page-RHBZ-1099289.patch new file mode 100644 index 0000000..0c235f5 --- /dev/null +++ b/SOURCES/0005-Fix-spelling-mistake-in-the-man-page-RHBZ-1099289.patch @@ -0,0 +1,25 @@ +From cc494d23a60c699bdc843ecb9d3564e69aae006c Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 20 May 2014 10:50:39 +0100 +Subject: [PATCH 05/26] Fix spelling mistake in the man page (RHBZ#1099289). + +--- + virt-what.pod | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/virt-what.pod b/virt-what.pod +index bff2998..bcafd26 100644 +--- a/virt-what.pod ++++ b/virt-what.pod +@@ -113,7 +113,7 @@ Status: contributed by Justin Clift + + The guest is running inside IBM PowerVM Lx86 Linux/x86 emulator. + +-Status: data originally supplied by Jeffrey Scheel, confimed by ++Status: data originally supplied by Jeffrey Scheel, confirmed by + Yufang Zhang and RWMJ + + =item B +-- +1.8.3.1 + diff --git a/SOURCES/0006-Added-check-and-test-routines-for-Docker.patch b/SOURCES/0006-Added-check-and-test-routines-for-Docker.patch new file mode 100644 index 0000000..c620fd6 --- /dev/null +++ b/SOURCES/0006-Added-check-and-test-routines-for-Docker.patch @@ -0,0 +1,142 @@ +From 89765910064584ebaea7a9899838a2cb66740d26 Mon Sep 17 00:00:00 2001 +From: Charles Nguyen +Date: Sat, 21 Jun 2014 22:27:51 -0500 +Subject: [PATCH 06/26] Added check and test routines for Docker + +--- + Makefile.am | 7 +++++++ + tests/docker/.dockerinit | 0 + tests/docker/proc/cpuinfo | 0 + tests/docker/proc/self/status | 0 + tests/docker/sbin/dmidecode | 6 ++++++ + tests/docker/sbin/uname | 2 ++ + tests/docker/sbin/virt-what-cpuid-helper | 2 ++ + tests/test-docker.sh | 34 ++++++++++++++++++++++++++++++++ + virt-what.in | 5 +++++ + 9 files changed, 56 insertions(+) + create mode 100644 tests/docker/.dockerinit + create mode 100644 tests/docker/proc/cpuinfo + create mode 100644 tests/docker/proc/self/status + create mode 100755 tests/docker/sbin/dmidecode + create mode 100755 tests/docker/sbin/uname + create mode 100755 tests/docker/sbin/virt-what-cpuid-helper + create mode 100755 tests/test-docker.sh + +diff --git a/Makefile.am b/Makefile.am +index 784d6db..24d1730 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -40,6 +40,7 @@ endif + + TESTS = \ + tests/test-baremetal.sh \ ++ tests/test-docker.sh \ + tests/test-esx4.1.sh \ + tests/test-hyperv.sh \ + tests/test-kvm.sh \ +@@ -63,6 +64,12 @@ EXTRA_DIST = \ + tests/baremetal/sbin/dmidecode \ + tests/baremetal/sbin/uname \ + tests/baremetal/sbin/virt-what-cpuid-helper \ ++ tests/docker/.dockerinit \ ++ tests/docker/proc/cpuinfo \ ++ tests/docker/proc/self/status \ ++ tests/docker/sbin/dmidecode \ ++ tests/docker/sbin/uname \ ++ tests/docker/sbin/virt-what-cpuid-helper \ + tests/esx4.1/proc/cpuinfo \ + tests/esx4.1/proc/self/status \ + tests/esx4.1/sbin/dmidecode \ +diff --git a/tests/docker/.dockerinit b/tests/docker/.dockerinit +new file mode 100644 +index 0000000..e69de29 +diff --git a/tests/docker/proc/cpuinfo b/tests/docker/proc/cpuinfo +new file mode 100644 +index 0000000..e69de29 +diff --git a/tests/docker/proc/self/status b/tests/docker/proc/self/status +new file mode 100644 +index 0000000..e69de29 +diff --git a/tests/docker/sbin/dmidecode b/tests/docker/sbin/dmidecode +new file mode 100755 +index 0000000..d9992ad +--- /dev/null ++++ b/tests/docker/sbin/dmidecode +@@ -0,0 +1,6 @@ ++#!/bin/sh - ++cat <<'EOF' ++# dmidecode 2.11 ++/dev/mem: Operation not permitted ++EOF ++exit 1 +diff --git a/tests/docker/sbin/uname b/tests/docker/sbin/uname +new file mode 100755 +index 0000000..ab0ec89 +--- /dev/null ++++ b/tests/docker/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo x86_64 +diff --git a/tests/docker/sbin/virt-what-cpuid-helper b/tests/docker/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..ad82504 +--- /dev/null ++++ b/tests/docker/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo @ +diff --git a/tests/test-docker.sh b/tests/test-docker.sh +new file mode 100755 +index 0000000..4187f61 +--- /dev/null ++++ b/tests/test-docker.sh +@@ -0,0 +1,34 @@ ++# Test for Docker ++# Copyright (C) 2008-2011 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++root=tests/docker ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="docker" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/virt-what.in b/virt-what.in +index fb399be..c04203e 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -248,3 +248,8 @@ if ! "$skip_qemu_kvm"; then + fi + fi + fi ++ ++# Check for Docker. ++if [ -f "${root}/.dockerinit" ]; then ++ echo docker ++fi +-- +1.8.3.1 + diff --git a/SOURCES/0006-virt-what.in-remove-bash-ism.patch b/SOURCES/0006-virt-what.in-remove-bash-ism.patch deleted file mode 100644 index 2194668..0000000 --- a/SOURCES/0006-virt-what.in-remove-bash-ism.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6382ef1cb5b8c146bfd35912730dccd68ab4b71a Mon Sep 17 00:00:00 2001 -From: "A. Gordon" -Date: Mon, 15 Sep 2014 14:48:23 -0400 -Subject: [PATCH 06/16] virt-what.in: remove bash-ism - -Use '/bin/sh' instead of '/bin/bash', with POSIX-compatible function -definitions. ---- - virt-what.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/virt-what.in b/virt-what.in -index c04203e..1532b90 100644 ---- a/virt-what.in -+++ b/virt-what.in -@@ -1,4 +1,4 @@ --#!/bin/bash - -+#!/bin/sh - - # @configure_input@ - # Copyright (C) 2008-2011 Red Hat Inc. - # -@@ -33,12 +33,12 @@ skip_qemu_kvm=false - - VERSION="@VERSION@" - --function fail { -+fail() { - echo "virt-what: $1" >&2 - exit 1 - } - --function usage { -+usage() { - echo "virt-what [options]" - echo "Options:" - echo " --help Display this help" --- -2.3.1 - diff --git a/SOURCES/0007-Added-documentation-for-Docker-tests.patch b/SOURCES/0007-Added-documentation-for-Docker-tests.patch new file mode 100644 index 0000000..50b9918 --- /dev/null +++ b/SOURCES/0007-Added-documentation-for-Docker-tests.patch @@ -0,0 +1,29 @@ +From aab6a7d67b4e3bb1f9697ded4dba8bc0c16d32fa Mon Sep 17 00:00:00 2001 +From: Charles Nguyen +Date: Sat, 21 Jun 2014 23:43:05 -0500 +Subject: [PATCH 07/26] Added documentation for Docker tests + +--- + virt-what.pod | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/virt-what.pod b/virt-what.pod +index bcafd26..8fd9bc4 100644 +--- a/virt-what.pod ++++ b/virt-what.pod +@@ -25,6 +25,12 @@ don't know about or cannot detect. + + =over 4 + ++=item B ++ ++This is a Docker container. ++ ++Status: confirmed by Charles Nguyen ++ + =item B + + This is Microsoft Hyper-V hypervisor. +-- +1.8.3.1 + diff --git a/SOURCES/0007-virt-what.in-get-effective-uid-in-a-portable-way.patch b/SOURCES/0007-virt-what.in-get-effective-uid-in-a-portable-way.patch deleted file mode 100644 index d252832..0000000 --- a/SOURCES/0007-virt-what.in-get-effective-uid-in-a-portable-way.patch +++ /dev/null @@ -1,28 +0,0 @@ -From f82984fb84e9fed84aa71a50a1bfdfdc356771bd Mon Sep 17 00:00:00 2001 -From: Assaf Gordon -Date: Mon, 15 Sep 2014 18:58:19 +0000 -Subject: [PATCH 07/16] virt-what.in: get effective uid in a portable way - -$EUID is bash-specific. Use the POSIX-compatible 'id -u' instead. ---- - virt-what.in | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/virt-what.in b/virt-what.in -index 1532b90..3feeb60 100644 ---- a/virt-what.in -+++ b/virt-what.in -@@ -74,8 +74,9 @@ exec_prefix=@exec_prefix@ - PATH="${root}@libexecdir@:${root}/sbin:${root}/usr/sbin:${PATH}" - - # Check we're running as root. -+EFFUID=$(id -u) || fail "failed to get current user id" - --if [ "x$root" = "x" ] && [ "$EUID" -ne 0 ]; then -+if [ "x$root" = "x" ] && [ "$EFFUID" -ne 0 ]; then - fail "this script must be run as root" - fi - --- -2.3.1 - diff --git a/SOURCES/0008-virt-what.in-remove-bash-ism.patch b/SOURCES/0008-virt-what.in-remove-bash-ism.patch new file mode 100644 index 0000000..766fdcd --- /dev/null +++ b/SOURCES/0008-virt-what.in-remove-bash-ism.patch @@ -0,0 +1,39 @@ +From 8769b28cce8fdbc7da0605b061242b9dba51fc20 Mon Sep 17 00:00:00 2001 +From: "A. Gordon" +Date: Mon, 15 Sep 2014 14:48:23 -0400 +Subject: [PATCH 08/26] virt-what.in: remove bash-ism + +Use '/bin/sh' instead of '/bin/bash', with POSIX-compatible function +definitions. +--- + virt-what.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/virt-what.in b/virt-what.in +index c04203e..1532b90 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -1,4 +1,4 @@ +-#!/bin/bash - ++#!/bin/sh - + # @configure_input@ + # Copyright (C) 2008-2011 Red Hat Inc. + # +@@ -33,12 +33,12 @@ skip_qemu_kvm=false + + VERSION="@VERSION@" + +-function fail { ++fail() { + echo "virt-what: $1" >&2 + exit 1 + } + +-function usage { ++usage() { + echo "virt-what [options]" + echo "Options:" + echo " --help Display this help" +-- +1.8.3.1 + diff --git a/SOURCES/0008-virt-what.in-warn-about-missing-cpuid-virt-helper-pr.patch b/SOURCES/0008-virt-what.in-warn-about-missing-cpuid-virt-helper-pr.patch deleted file mode 100644 index f06cb49..0000000 --- a/SOURCES/0008-virt-what.in-warn-about-missing-cpuid-virt-helper-pr.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e3e88af8847a4269fb275fd054fc36c5066d5d49 Mon Sep 17 00:00:00 2001 -From: Assaf Gordon -Date: Mon, 15 Sep 2014 19:08:20 +0000 -Subject: [PATCH 08/16] virt-what.in: warn about missing cpuid-virt helper - program - -Try to find the binary program on the $PATH, and give informative error -message if it wasn't found. ---- - virt-what.in | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/virt-what.in b/virt-what.in -index 3feeb60..5ae1ccb 100644 ---- a/virt-what.in -+++ b/virt-what.in -@@ -80,6 +80,12 @@ if [ "x$root" = "x" ] && [ "$EFFUID" -ne 0 ]; then - fail "this script must be run as root" - fi - -+# Try to locate the CPU-ID helper program -+CPUID_HELPER=$(which virt-what-cpuid-helper 2>/dev/null) -+if [ -z "$CPUID_HELPER" ] ; then -+ fail "virt-what-cpuid-helper program not found in \$PATH" -+fi -+ - # Many fullvirt hypervisors give an indication through CPUID. Use the - # helper program to get this information. - --- -2.3.1 - diff --git a/SOURCES/0009-virt-what.in-get-effective-uid-in-a-portable-way.patch b/SOURCES/0009-virt-what.in-get-effective-uid-in-a-portable-way.patch new file mode 100644 index 0000000..6c010c3 --- /dev/null +++ b/SOURCES/0009-virt-what.in-get-effective-uid-in-a-portable-way.patch @@ -0,0 +1,28 @@ +From e1e79b9a988ab66f7ab673034488b42057621320 Mon Sep 17 00:00:00 2001 +From: Assaf Gordon +Date: Mon, 15 Sep 2014 18:58:19 +0000 +Subject: [PATCH 09/26] virt-what.in: get effective uid in a portable way + +$EUID is bash-specific. Use the POSIX-compatible 'id -u' instead. +--- + virt-what.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/virt-what.in b/virt-what.in +index 1532b90..3feeb60 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -74,8 +74,9 @@ exec_prefix=@exec_prefix@ + PATH="${root}@libexecdir@:${root}/sbin:${root}/usr/sbin:${PATH}" + + # Check we're running as root. ++EFFUID=$(id -u) || fail "failed to get current user id" + +-if [ "x$root" = "x" ] && [ "$EUID" -ne 0 ]; then ++if [ "x$root" = "x" ] && [ "$EFFUID" -ne 0 ]; then + fail "this script must be run as root" + fi + +-- +1.8.3.1 + diff --git a/SOURCES/0009-virt-what.in-verify-files-exists-before-grepping-the.patch b/SOURCES/0009-virt-what.in-verify-files-exists-before-grepping-the.patch deleted file mode 100644 index ae46979..0000000 --- a/SOURCES/0009-virt-what.in-verify-files-exists-before-grepping-the.patch +++ /dev/null @@ -1,65 +0,0 @@ -From a68e9c005933a2d8d0f3264bdb68161263cd3933 Mon Sep 17 00:00:00 2001 -From: Assaf Gordon -Date: Mon, 15 Sep 2014 19:15:19 +0000 -Subject: [PATCH 09/16] virt-what.in: verify files exists before grepping them - -Don't grep linux-specific files (e.g. /proc/cpuinfo) unless they exist. -This avoids extraneous errors on BSD/Hurd systems which don't have these -files. ---- - virt-what.in | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - -diff --git a/virt-what.in b/virt-what.in -index 5ae1ccb..6e9aef1 100644 ---- a/virt-what.in -+++ b/virt-what.in -@@ -33,6 +33,10 @@ skip_qemu_kvm=false - - VERSION="@VERSION@" - -+have_cpuinfo() { -+ test -e "${root}/proc/cpuinfo" -+} -+ - fail() { - echo "virt-what: $1" >&2 - exit 1 -@@ -152,7 +156,8 @@ if [ -e "${root}/proc/1/environ" ] && - fi - - # Check for Linux-VServer --if cat "${root}/proc/self/status" | grep -q "VxID: [0-9]*"; then -+if test -e "${root}/proc/self/status" \ -+ && cat "${root}/proc/self/status" | grep -q "VxID: [0-9]*"; then - echo linux_vserver - if grep -q "VxID: 0$" "${root}/proc/self/status"; then - echo linux_vserver-host -@@ -163,12 +168,13 @@ fi - - # Check for UML. - # Added by Laurent Léonard. --if grep -q 'UML' "${root}/proc/cpuinfo"; then -+if have_cpuinfo && grep -q 'UML' "${root}/proc/cpuinfo"; then - echo uml - fi - - # Check for IBM PowerVM Lx86 Linux/x86 emulator. --if grep -q '^vendor_id.*PowerVM Lx86' "${root}/proc/cpuinfo"; then -+if have_cpuinfo && grep -q '^vendor_id.*PowerVM Lx86' "${root}/proc/cpuinfo" -+then - echo powervm_lx86 - fi - -@@ -179,7 +185,7 @@ if echo "$dmi" | grep -q 'Manufacturer.*HITACHI' && - fi - - # Check for IBM SystemZ. --if grep -q '^vendor_id.*IBM/S390' "${root}/proc/cpuinfo"; then -+if have_cpuinfo && grep -q '^vendor_id.*IBM/S390' "${root}/proc/cpuinfo"; then - echo ibm_systemz - if [ -f "${root}/proc/sysinfo" ]; then - if grep -q 'VM.*Control Program.*z/VM' "${root}/proc/sysinfo"; then --- -2.3.1 - diff --git a/SOURCES/0010-virt-what.in-make-option-processing-portable.patch b/SOURCES/0010-virt-what.in-make-option-processing-portable.patch deleted file mode 100644 index a4b28d8..0000000 --- a/SOURCES/0010-virt-what.in-make-option-processing-portable.patch +++ /dev/null @@ -1,52 +0,0 @@ -From aec669f7b9e4a172c57978597916f8bd97bf26de Mon Sep 17 00:00:00 2001 -From: Assaf Gordon -Date: Mon, 15 Sep 2014 19:34:06 +0000 -Subject: [PATCH 10/16] virt-what.in: make option processing portable - -Replace linux-specific 'getopt' usage with manual option parsing. -Because the used option are version simple (help/version) and the only -additional option is undocumented (--test-root), it's easy remove the -'getopt' usage, and make this script portable to BSD systems. ---- - virt-what.in | 17 +++++++---------- - 1 file changed, 7 insertions(+), 10 deletions(-) - -diff --git a/virt-what.in b/virt-what.in -index 6e9aef1..f2c0b90 100644 ---- a/virt-what.in -+++ b/virt-what.in -@@ -51,24 +51,21 @@ usage() { - } - - # Handle the command line arguments, if any. -- --TEMP=$(getopt -o v --long help --long version --long test-root: -n 'virt-what' -- "$@") --if [ $? != 0 ]; then exit 1; fi --eval set -- "$TEMP" -- --while true; do -+while test $# -gt 0; do - case "$1" in - --help) usage ;; -- --test-root) -+ --test-root=*) - # Deliberately undocumented: used for 'make check'. -- root="$2" -- shift 2 -+ root=$(echo "$1" | sed 's/.*=//') -+ shift 1 -+ test -z "$root" && fail "--test-root option requires a value" - ;; - -v|--version) echo "$VERSION"; exit 0 ;; - --) shift; break ;; -- *) fail "internal error ($1)" ;; -+ *) fail "unrecognized option '$1'";; - esac - done -+test $# -gt 0 && fail "extra operand '$1'" - - # Add /sbin and /usr/sbin to the path so we can find system - # binaries like dmidecode. --- -2.3.1 - diff --git a/SOURCES/0010-virt-what.in-warn-about-missing-cpuid-virt-helper-pr.patch b/SOURCES/0010-virt-what.in-warn-about-missing-cpuid-virt-helper-pr.patch new file mode 100644 index 0000000..d1a7971 --- /dev/null +++ b/SOURCES/0010-virt-what.in-warn-about-missing-cpuid-virt-helper-pr.patch @@ -0,0 +1,32 @@ +From d3908f46427a9126742a70967cf787edfd37ab43 Mon Sep 17 00:00:00 2001 +From: Assaf Gordon +Date: Mon, 15 Sep 2014 19:08:20 +0000 +Subject: [PATCH 10/26] virt-what.in: warn about missing cpuid-virt helper + program + +Try to find the binary program on the $PATH, and give informative error +message if it wasn't found. +--- + virt-what.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/virt-what.in b/virt-what.in +index 3feeb60..5ae1ccb 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -80,6 +80,12 @@ if [ "x$root" = "x" ] && [ "$EFFUID" -ne 0 ]; then + fail "this script must be run as root" + fi + ++# Try to locate the CPU-ID helper program ++CPUID_HELPER=$(which virt-what-cpuid-helper 2>/dev/null) ++if [ -z "$CPUID_HELPER" ] ; then ++ fail "virt-what-cpuid-helper program not found in \$PATH" ++fi ++ + # Many fullvirt hypervisors give an indication through CPUID. Use the + # helper program to get this information. + +-- +1.8.3.1 + diff --git a/SOURCES/0011-build-use-portable-Makefile-variables.patch b/SOURCES/0011-build-use-portable-Makefile-variables.patch deleted file mode 100644 index fec478a..0000000 --- a/SOURCES/0011-build-use-portable-Makefile-variables.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 243928da395080d7895111d5e5c0f1ff5f9e95fb Mon Sep 17 00:00:00 2001 -From: "A. Gordon" -Date: Mon, 15 Sep 2014 15:51:50 -0400 -Subject: [PATCH 11/16] build: use portable Makefile variables - -* Makefile.am: use '$?' instead of '$<' - $< in a non-inference rule is a GNU-make extension, which fails with - BSD make. ---- - Makefile.am | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 24d1730..1c14948 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -32,9 +32,9 @@ man_MANS = virt-what.1 - - virt-what.1: virt-what.pod - pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \ -- $< > $@ -+ $? > $@ - virt-what.txt: virt-what.pod -- pod2text $< > $@ -+ pod2text $? > $@ - - endif - --- -2.3.1 - diff --git a/SOURCES/0011-virt-what.in-verify-files-exists-before-grepping-the.patch b/SOURCES/0011-virt-what.in-verify-files-exists-before-grepping-the.patch new file mode 100644 index 0000000..526e6b6 --- /dev/null +++ b/SOURCES/0011-virt-what.in-verify-files-exists-before-grepping-the.patch @@ -0,0 +1,65 @@ +From 960e513f430170bb58d59dcb26951f879a9baa7b Mon Sep 17 00:00:00 2001 +From: Assaf Gordon +Date: Mon, 15 Sep 2014 19:15:19 +0000 +Subject: [PATCH 11/26] virt-what.in: verify files exists before grepping them + +Don't grep linux-specific files (e.g. /proc/cpuinfo) unless they exist. +This avoids extraneous errors on BSD/Hurd systems which don't have these +files. +--- + virt-what.in | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/virt-what.in b/virt-what.in +index 5ae1ccb..6e9aef1 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -33,6 +33,10 @@ skip_qemu_kvm=false + + VERSION="@VERSION@" + ++have_cpuinfo() { ++ test -e "${root}/proc/cpuinfo" ++} ++ + fail() { + echo "virt-what: $1" >&2 + exit 1 +@@ -152,7 +156,8 @@ if [ -e "${root}/proc/1/environ" ] && + fi + + # Check for Linux-VServer +-if cat "${root}/proc/self/status" | grep -q "VxID: [0-9]*"; then ++if test -e "${root}/proc/self/status" \ ++ && cat "${root}/proc/self/status" | grep -q "VxID: [0-9]*"; then + echo linux_vserver + if grep -q "VxID: 0$" "${root}/proc/self/status"; then + echo linux_vserver-host +@@ -163,12 +168,13 @@ fi + + # Check for UML. + # Added by Laurent Léonard. +-if grep -q 'UML' "${root}/proc/cpuinfo"; then ++if have_cpuinfo && grep -q 'UML' "${root}/proc/cpuinfo"; then + echo uml + fi + + # Check for IBM PowerVM Lx86 Linux/x86 emulator. +-if grep -q '^vendor_id.*PowerVM Lx86' "${root}/proc/cpuinfo"; then ++if have_cpuinfo && grep -q '^vendor_id.*PowerVM Lx86' "${root}/proc/cpuinfo" ++then + echo powervm_lx86 + fi + +@@ -179,7 +185,7 @@ if echo "$dmi" | grep -q 'Manufacturer.*HITACHI' && + fi + + # Check for IBM SystemZ. +-if grep -q '^vendor_id.*IBM/S390' "${root}/proc/cpuinfo"; then ++if have_cpuinfo && grep -q '^vendor_id.*IBM/S390' "${root}/proc/cpuinfo"; then + echo ibm_systemz + if [ -f "${root}/proc/sysinfo" ]; then + if grep -q 'VM.*Control Program.*z/VM' "${root}/proc/sysinfo"; then +-- +1.8.3.1 + diff --git a/SOURCES/0012-Add-space-before-parens-in-function-defns-for-readab.patch b/SOURCES/0012-Add-space-before-parens-in-function-defns-for-readab.patch deleted file mode 100644 index 2f94a10..0000000 --- a/SOURCES/0012-Add-space-before-parens-in-function-defns-for-readab.patch +++ /dev/null @@ -1,37 +0,0 @@ -From bdb7404ca6221d6d18e1a4864aa2cd0698164a06 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 16 Sep 2014 19:02:18 +0100 -Subject: [PATCH 12/16] Add space before parens in function defns for - readability. - ---- - virt-what.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/virt-what.in b/virt-what.in -index f2c0b90..0770070 100644 ---- a/virt-what.in -+++ b/virt-what.in -@@ -33,16 +33,16 @@ skip_qemu_kvm=false - - VERSION="@VERSION@" - --have_cpuinfo() { -+have_cpuinfo () { - test -e "${root}/proc/cpuinfo" - } - --fail() { -+fail () { - echo "virt-what: $1" >&2 - exit 1 - } - --usage() { -+usage () { - echo "virt-what [options]" - echo "Options:" - echo " --help Display this help" --- -2.3.1 - diff --git a/SOURCES/0012-virt-what.in-make-option-processing-portable.patch b/SOURCES/0012-virt-what.in-make-option-processing-portable.patch new file mode 100644 index 0000000..935c8fd --- /dev/null +++ b/SOURCES/0012-virt-what.in-make-option-processing-portable.patch @@ -0,0 +1,52 @@ +From 5d4106eafd7f2f6e71a1d0d90ebf4f4e766b772d Mon Sep 17 00:00:00 2001 +From: Assaf Gordon +Date: Mon, 15 Sep 2014 19:34:06 +0000 +Subject: [PATCH 12/26] virt-what.in: make option processing portable + +Replace linux-specific 'getopt' usage with manual option parsing. +Because the used option are version simple (help/version) and the only +additional option is undocumented (--test-root), it's easy remove the +'getopt' usage, and make this script portable to BSD systems. +--- + virt-what.in | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +diff --git a/virt-what.in b/virt-what.in +index 6e9aef1..f2c0b90 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -51,24 +51,21 @@ usage() { + } + + # Handle the command line arguments, if any. +- +-TEMP=$(getopt -o v --long help --long version --long test-root: -n 'virt-what' -- "$@") +-if [ $? != 0 ]; then exit 1; fi +-eval set -- "$TEMP" +- +-while true; do ++while test $# -gt 0; do + case "$1" in + --help) usage ;; +- --test-root) ++ --test-root=*) + # Deliberately undocumented: used for 'make check'. +- root="$2" +- shift 2 ++ root=$(echo "$1" | sed 's/.*=//') ++ shift 1 ++ test -z "$root" && fail "--test-root option requires a value" + ;; + -v|--version) echo "$VERSION"; exit 0 ;; + --) shift; break ;; +- *) fail "internal error ($1)" ;; ++ *) fail "unrecognized option '$1'";; + esac + done ++test $# -gt 0 && fail "extra operand '$1'" + + # Add /sbin and /usr/sbin to the path so we can find system + # binaries like dmidecode. +-- +1.8.3.1 + diff --git a/SOURCES/0013-Add-lkvm-detection.patch b/SOURCES/0013-Add-lkvm-detection.patch deleted file mode 100644 index f9ccb33..0000000 --- a/SOURCES/0013-Add-lkvm-detection.patch +++ /dev/null @@ -1,237 +0,0 @@ -From 18d21a55c9551b76f0cdb93cd8e7b127173f083b Mon Sep 17 00:00:00 2001 -From: Andrew Jones -Date: Fri, 27 Mar 2015 21:18:59 +0100 -Subject: [PATCH 13/16] Add lkvm detection - -Signed-off-by: Andrew Jones ---- - Makefile.am | 6 ++++++ - tests/lkvm/proc/cpuinfo | 19 +++++++++++++++++ - tests/lkvm/proc/self/status | 39 ++++++++++++++++++++++++++++++++++ - tests/lkvm/sbin/dmidecode | 2 ++ - tests/lkvm/sbin/uname | 2 ++ - tests/lkvm/sbin/virt-what-cpuid-helper | 2 ++ - tests/test-lkvm.sh | 34 +++++++++++++++++++++++++++++ - virt-what.in | 8 +++++++ - virt-what.pod | 8 +++++++ - 9 files changed, 120 insertions(+) - create mode 100644 tests/lkvm/proc/cpuinfo - create mode 100644 tests/lkvm/proc/self/status - create mode 100755 tests/lkvm/sbin/dmidecode - create mode 100755 tests/lkvm/sbin/uname - create mode 100755 tests/lkvm/sbin/virt-what-cpuid-helper - create mode 100755 tests/test-lkvm.sh - -diff --git a/Makefile.am b/Makefile.am -index 1c14948..46ff548 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -46,6 +46,7 @@ TESTS = \ - tests/test-kvm.sh \ - tests/test-kvm-explicit-cpu.sh \ - tests/test-linux-vserver.sh \ -+ tests/test-lkvm.sh \ - tests/test-lxc.sh \ - tests/test-lx86.sh \ - tests/test-parallels-desktop.sh \ -@@ -95,6 +96,11 @@ EXTRA_DIST = \ - tests/linux-vserver/sbin/dmidecode \ - tests/linux-vserver/sbin/uname \ - tests/linux-vserver/sbin/virt-what-cpuid-helper \ -+ tests/lkvm/proc/cpuinfo \ -+ tests/lkvm/proc/self/status \ -+ tests/lkvm/sbin/dmidecode \ -+ tests/lkvm/sbin/uname \ -+ tests/lkvm/sbin/virt-what-cpuid-helper \ - tests/lxc/proc/1/environ \ - tests/lxc/proc/cpuinfo \ - tests/lxc/proc/self/status \ -diff --git a/tests/lkvm/proc/cpuinfo b/tests/lkvm/proc/cpuinfo -new file mode 100644 -index 0000000..a53a4b9 ---- /dev/null -+++ b/tests/lkvm/proc/cpuinfo -@@ -0,0 +1,19 @@ -+processor : 0 -+vendor_id : GenuineIntel -+cpu family : 6 -+model : 15 -+model name : Intel(R) Core(TM)2 Duo CPU T7700 @ 2.40GHz -+stepping : 11 -+cpu MHz : 2659.998 -+cache size : 4096 KB -+fpu : yes -+fpu_exception : yes -+cpuid level : 10 -+wp : yes -+flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx lm constant_tsc up rep_good pni ssse3 cx16 hypervisor lahf_lm -+bogomips : 5319.99 -+clflush size : 64 -+cache_alignment : 64 -+address sizes : 40 bits physical, 48 bits virtual -+power management: -+ -diff --git a/tests/lkvm/proc/self/status b/tests/lkvm/proc/self/status -new file mode 100644 -index 0000000..264981d ---- /dev/null -+++ b/tests/lkvm/proc/self/status -@@ -0,0 +1,39 @@ -+Name: cat -+State: R (running) -+Tgid: 1618 -+Pid: 1618 -+PPid: 1609 -+TracerPid: 0 -+Uid: 0 0 0 0 -+Gid: 0 0 0 0 -+Utrace: 0 -+FDSize: 256 -+Groups: 0 1 2 3 4 6 10 -+VmPeak: 101012 kB -+VmSize: 101012 kB -+VmLck: 0 kB -+VmHWM: 472 kB -+VmRSS: 472 kB -+VmData: 184 kB -+VmStk: 136 kB -+VmExe: 44 kB -+VmLib: 1728 kB -+VmPTE: 44 kB -+VmSwap: 0 kB -+Threads: 1 -+SigQ: 0/7858 -+SigPnd: 0000000000000000 -+ShdPnd: 0000000000000000 -+SigBlk: 0000000000000000 -+SigIgn: 0000000000000000 -+SigCgt: 0000000000000000 -+CapInh: 0000000000000000 -+CapPrm: ffffffffffffffff -+CapEff: ffffffffffffffff -+CapBnd: ffffffffffffffff -+Cpus_allowed: 1 -+Cpus_allowed_list: 0 -+Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 -+Mems_allowed_list: 0 -+voluntary_ctxt_switches: 0 -+nonvoluntary_ctxt_switches: 1 -diff --git a/tests/lkvm/sbin/dmidecode b/tests/lkvm/sbin/dmidecode -new file mode 100755 -index 0000000..e53c12f ---- /dev/null -+++ b/tests/lkvm/sbin/dmidecode -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+exit 1 -diff --git a/tests/lkvm/sbin/uname b/tests/lkvm/sbin/uname -new file mode 100755 -index 0000000..ab0ec89 ---- /dev/null -+++ b/tests/lkvm/sbin/uname -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+echo x86_64 -diff --git a/tests/lkvm/sbin/virt-what-cpuid-helper b/tests/lkvm/sbin/virt-what-cpuid-helper -new file mode 100755 -index 0000000..2b068cd ---- /dev/null -+++ b/tests/lkvm/sbin/virt-what-cpuid-helper -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+echo LKVMLKVMLKVM -diff --git a/tests/test-lkvm.sh b/tests/test-lkvm.sh -new file mode 100755 -index 0000000..6eb326c ---- /dev/null -+++ b/tests/test-lkvm.sh -@@ -0,0 +1,34 @@ -+# Test for LKVM -+# Copyright (C) 2015 Red Hat Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+root=tests/lkvm -+ -+output="$(./virt-what --test-root=$root 2>&1)" -+expected="lkvm" -+ -+if [ "$output" != "$expected" ]; then -+ echo "$0: test failed because output did not match expected" -+ echo "Expected output was:" -+ echo "----------------------------------------" -+ echo "$expected" -+ echo "----------------------------------------" -+ echo "But the actual output of the program was:" -+ echo "----------------------------------------" -+ echo "$output" -+ echo "----------------------------------------" -+ exit 1 -+fi -diff --git a/virt-what.in b/virt-what.in -index 0770070..ed08dae 100644 ---- a/virt-what.in -+++ b/virt-what.in -@@ -30,6 +30,7 @@ - set -u - root='' - skip_qemu_kvm=false -+skip_lkvm=false - - VERSION="@VERSION@" - -@@ -215,6 +216,7 @@ elif [ -d "${root}/proc/xen" ]; then - echo xen-domU - fi - skip_qemu_kvm=true -+ skip_lkvm=true - elif [ -f "${root}/sys/hypervisor/type" ] && - grep -q "xen" "${root}/sys/hypervisor/type"; then - # Ordinary kernel with pv_ops. There does not seem to be -@@ -259,6 +261,12 @@ if ! "$skip_qemu_kvm"; then - fi - fi - -+if ! "$skip_lkvm"; then -+ if [ "$cpuid" = "LKVMLKVMLKVM" ]; then -+ echo lkvm -+ fi -+fi -+ - # Check for Docker. - if [ -f "${root}/.dockerinit" ]; then - echo docker -diff --git a/virt-what.pod b/virt-what.pod -index 8fd9bc4..0e2e8a5 100644 ---- a/virt-what.pod -+++ b/virt-what.pod -@@ -101,6 +101,14 @@ instead. - - Status: confirmed by RWMJ. - -+=item B -+ -+This guest is running on the KVM hypervisor using hardware -+acceleration, and the userspace component of the hypervisor -+is lkvm (a.k.a kvmtool). -+ -+Status: contributed by Andrew Jones -+ - =item B - - The guest appears to be running inside an OpenVZ or Virtuozzo --- -2.3.1 - diff --git a/SOURCES/0013-build-use-portable-Makefile-variables.patch b/SOURCES/0013-build-use-portable-Makefile-variables.patch new file mode 100644 index 0000000..5592a14 --- /dev/null +++ b/SOURCES/0013-build-use-portable-Makefile-variables.patch @@ -0,0 +1,31 @@ +From b53bdd3ebadab879f161e0e4b881c79cb977e0e0 Mon Sep 17 00:00:00 2001 +From: "A. Gordon" +Date: Mon, 15 Sep 2014 15:51:50 -0400 +Subject: [PATCH 13/26] build: use portable Makefile variables + +* Makefile.am: use '$?' instead of '$<' + $< in a non-inference rule is a GNU-make extension, which fails with + BSD make. +--- + Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 24d1730..1c14948 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -32,9 +32,9 @@ man_MANS = virt-what.1 + + virt-what.1: virt-what.pod + pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \ +- $< > $@ ++ $? > $@ + virt-what.txt: virt-what.pod +- pod2text $< > $@ ++ pod2text $? > $@ + + endif + +-- +1.8.3.1 + diff --git a/SOURCES/0014-Add-ARM-support.patch b/SOURCES/0014-Add-ARM-support.patch deleted file mode 100644 index 268f813..0000000 --- a/SOURCES/0014-Add-ARM-support.patch +++ /dev/null @@ -1,736 +0,0 @@ -From 87d670b4c8b4e4e0cc314736562a9a6612d555ef Mon Sep 17 00:00:00 2001 -From: Andrew Jones -Date: Fri, 27 Mar 2015 21:19:00 +0100 -Subject: [PATCH 14/16] Add ARM support - -Currently only detects LKVM, QEMU/KVM, and Xen. Also only works if -the guest is booted with DT (which is the only way that currently -exists). - -Signed-off-by: Andrew Jones ---- - Makefile.am | 21 ++++++++ - tests/lkvm-arm/proc/cpuinfo | 63 ++++++++++++++++++++++ - tests/lkvm-arm/proc/device-tree/compatible | 1 + - tests/lkvm-arm/proc/self/status | 41 ++++++++++++++ - tests/lkvm-arm/sbin/dmidecode | 2 + - tests/lkvm-arm/sbin/uname | 2 + - tests/lkvm-arm/sbin/virt-what-cpuid-helper | 2 + - tests/qemu-arm/proc/cpuinfo | 63 ++++++++++++++++++++++ - .../proc/device-tree/fw-cfg@9020000/compatible | 1 + - tests/qemu-arm/proc/self/status | 41 ++++++++++++++ - tests/qemu-arm/sbin/dmidecode | 2 + - tests/qemu-arm/sbin/uname | 2 + - tests/qemu-arm/sbin/virt-what-cpuid-helper | 2 + - tests/test-lkvm-arm.sh | 34 ++++++++++++ - tests/test-qemu-arm.sh | 34 ++++++++++++ - tests/test-xen-arm.sh | 34 ++++++++++++ - tests/xen-arm/proc/cpuinfo | 63 ++++++++++++++++++++++ - .../xen-arm/proc/device-tree/hypervisor/compatible | 1 + - tests/xen-arm/proc/self/status | 41 ++++++++++++++ - tests/xen-arm/sbin/dmidecode | 2 + - tests/xen-arm/sbin/uname | 2 + - tests/xen-arm/sbin/virt-what-cpuid-helper | 2 + - virt-what.in | 22 +++++++- - 23 files changed, 477 insertions(+), 1 deletion(-) - create mode 100644 tests/lkvm-arm/proc/cpuinfo - create mode 100644 tests/lkvm-arm/proc/device-tree/compatible - create mode 100644 tests/lkvm-arm/proc/self/status - create mode 100755 tests/lkvm-arm/sbin/dmidecode - create mode 100755 tests/lkvm-arm/sbin/uname - create mode 100755 tests/lkvm-arm/sbin/virt-what-cpuid-helper - create mode 100644 tests/qemu-arm/proc/cpuinfo - create mode 100644 tests/qemu-arm/proc/device-tree/fw-cfg@9020000/compatible - create mode 100644 tests/qemu-arm/proc/self/status - create mode 100755 tests/qemu-arm/sbin/dmidecode - create mode 100755 tests/qemu-arm/sbin/uname - create mode 100755 tests/qemu-arm/sbin/virt-what-cpuid-helper - create mode 100755 tests/test-lkvm-arm.sh - create mode 100755 tests/test-qemu-arm.sh - create mode 100755 tests/test-xen-arm.sh - create mode 100644 tests/xen-arm/proc/cpuinfo - create mode 100644 tests/xen-arm/proc/device-tree/hypervisor/compatible - create mode 100644 tests/xen-arm/proc/self/status - create mode 100755 tests/xen-arm/sbin/dmidecode - create mode 100755 tests/xen-arm/sbin/uname - create mode 100755 tests/xen-arm/sbin/virt-what-cpuid-helper - -diff --git a/Makefile.am b/Makefile.am -index 46ff548..514d229 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -47,14 +47,17 @@ TESTS = \ - tests/test-kvm-explicit-cpu.sh \ - tests/test-linux-vserver.sh \ - tests/test-lkvm.sh \ -+ tests/test-lkvm-arm.sh \ - tests/test-lxc.sh \ - tests/test-lx86.sh \ - tests/test-parallels-desktop.sh \ - tests/test-qemu.sh \ -+ tests/test-qemu-arm.sh \ - tests/test-rhel5-xen-dom0.sh \ - tests/test-rhel5-xen-domU-hvm.sh \ - tests/test-rhel5-xen-domU-hvm-ia64.sh \ - tests/test-rhel5-xen-domU-pv.sh \ -+ tests/test-xen-arm.sh \ - tests/test-zvm.sh - - EXTRA_DIST = \ -@@ -101,6 +104,12 @@ EXTRA_DIST = \ - tests/lkvm/sbin/dmidecode \ - tests/lkvm/sbin/uname \ - tests/lkvm/sbin/virt-what-cpuid-helper \ -+ tests/lkvm-arm/proc/cpuinfo \ -+ tests/lkvm-arm/proc/device-tree/compatible \ -+ tests/lkvm-arm/proc/self/status \ -+ tests/lkvm-arm/sbin/dmidecode \ -+ tests/lkvm-arm/sbin/uname \ -+ tests/lkvm-arm/sbin/virt-what-cpuid-helper \ - tests/lxc/proc/1/environ \ - tests/lxc/proc/cpuinfo \ - tests/lxc/proc/self/status \ -@@ -122,6 +131,12 @@ EXTRA_DIST = \ - tests/qemu/sbin/dmidecode \ - tests/qemu/sbin/uname \ - tests/qemu/sbin/virt-what-cpuid-helper \ -+ tests/qemu-arm/proc/cpuinfo \ -+ tests/qemu-arm/proc/device-tree/fw-cfg@9020000/compatible \ -+ tests/qemu-arm/proc/self/status \ -+ tests/qemu-arm/sbin/dmidecode \ -+ tests/qemu-arm/sbin/uname \ -+ tests/qemu-arm/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 \ -@@ -185,6 +200,12 @@ EXTRA_DIST = \ - tests/rhel5-xen-domU-pv/sys/hypervisor/compilation/compiled_by \ - tests/rhel5-xen-domU-pv/sys/hypervisor/compilation/compile_date \ - tests/rhel5-xen-domU-pv/sys/hypervisor/uuid \ -+ tests/xen-arm/proc/cpuinfo \ -+ tests/xen-arm/proc/device-tree/compatible \ -+ tests/xen-arm/proc/self/status \ -+ tests/xen-arm/sbin/dmidecode \ -+ tests/xen-arm/sbin/uname \ -+ tests/xen-arm/sbin/virt-what-cpuid-helper \ - tests/zvm/proc/cpuinfo \ - tests/zvm/proc/self/status \ - tests/zvm/proc/sysinfo \ -diff --git a/tests/lkvm-arm/proc/cpuinfo b/tests/lkvm-arm/proc/cpuinfo -new file mode 100644 -index 0000000..b83a182 ---- /dev/null -+++ b/tests/lkvm-arm/proc/cpuinfo -@@ -0,0 +1,63 @@ -+processor : 0 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 1 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 2 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 3 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 4 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 5 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 6 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 7 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -diff --git a/tests/lkvm-arm/proc/device-tree/compatible b/tests/lkvm-arm/proc/device-tree/compatible -new file mode 100644 -index 0000000..99642ed ---- /dev/null -+++ b/tests/lkvm-arm/proc/device-tree/compatible -@@ -0,0 +1 @@ -+linux,dummy-virt -diff --git a/tests/lkvm-arm/proc/self/status b/tests/lkvm-arm/proc/self/status -new file mode 100644 -index 0000000..751f5e7 ---- /dev/null -+++ b/tests/lkvm-arm/proc/self/status -@@ -0,0 +1,41 @@ -+Name: cat -+State: R (running) -+Tgid: 8307 -+Ngid: 0 -+Pid: 8307 -+PPid: 1415 -+TracerPid: 0 -+Uid: 0 0 0 0 -+Gid: 0 0 0 0 -+FDSize: 256 -+Groups: -+VmPeak: 109696 kB -+VmSize: 109696 kB -+VmLck: 0 kB -+VmPin: 0 kB -+VmHWM: 832 kB -+VmRSS: 832 kB -+VmData: 320 kB -+VmStk: 256 kB -+VmExe: 64 kB -+VmLib: 1536 kB -+VmPTE: 192 kB -+VmSwap: 0 kB -+Threads: 1 -+SigQ: 0/5821 -+SigPnd: 0000000000000000 -+ShdPnd: 0000000000000000 -+SigBlk: 0000000000000000 -+SigIgn: 0000000000000000 -+SigCgt: 0000000000000000 -+CapInh: 0000000000000000 -+CapPrm: 0000003fffffffff -+CapEff: 0000003fffffffff -+CapBnd: 0000003fffffffff -+Seccomp: 0 -+Cpus_allowed: ff -+Cpus_allowed_list: 0-7 -+Mems_allowed: 1 -+Mems_allowed_list: 0 -+voluntary_ctxt_switches: 1 -+nonvoluntary_ctxt_switches: 1 -diff --git a/tests/lkvm-arm/sbin/dmidecode b/tests/lkvm-arm/sbin/dmidecode -new file mode 100755 -index 0000000..e53c12f ---- /dev/null -+++ b/tests/lkvm-arm/sbin/dmidecode -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+exit 1 -diff --git a/tests/lkvm-arm/sbin/uname b/tests/lkvm-arm/sbin/uname -new file mode 100755 -index 0000000..bd33a2d ---- /dev/null -+++ b/tests/lkvm-arm/sbin/uname -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+echo aarch64 -diff --git a/tests/lkvm-arm/sbin/virt-what-cpuid-helper b/tests/lkvm-arm/sbin/virt-what-cpuid-helper -new file mode 100755 -index 0000000..77a6692 ---- /dev/null -+++ b/tests/lkvm-arm/sbin/virt-what-cpuid-helper -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+# nothing -diff --git a/tests/qemu-arm/proc/cpuinfo b/tests/qemu-arm/proc/cpuinfo -new file mode 100644 -index 0000000..b83a182 ---- /dev/null -+++ b/tests/qemu-arm/proc/cpuinfo -@@ -0,0 +1,63 @@ -+processor : 0 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 1 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 2 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 3 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 4 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 5 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 6 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 7 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -diff --git a/tests/qemu-arm/proc/device-tree/fw-cfg@9020000/compatible b/tests/qemu-arm/proc/device-tree/fw-cfg@9020000/compatible -new file mode 100644 -index 0000000..3932ade ---- /dev/null -+++ b/tests/qemu-arm/proc/device-tree/fw-cfg@9020000/compatible -@@ -0,0 +1 @@ -+qemu,fw-cfg-mmio -diff --git a/tests/qemu-arm/proc/self/status b/tests/qemu-arm/proc/self/status -new file mode 100644 -index 0000000..751f5e7 ---- /dev/null -+++ b/tests/qemu-arm/proc/self/status -@@ -0,0 +1,41 @@ -+Name: cat -+State: R (running) -+Tgid: 8307 -+Ngid: 0 -+Pid: 8307 -+PPid: 1415 -+TracerPid: 0 -+Uid: 0 0 0 0 -+Gid: 0 0 0 0 -+FDSize: 256 -+Groups: -+VmPeak: 109696 kB -+VmSize: 109696 kB -+VmLck: 0 kB -+VmPin: 0 kB -+VmHWM: 832 kB -+VmRSS: 832 kB -+VmData: 320 kB -+VmStk: 256 kB -+VmExe: 64 kB -+VmLib: 1536 kB -+VmPTE: 192 kB -+VmSwap: 0 kB -+Threads: 1 -+SigQ: 0/5821 -+SigPnd: 0000000000000000 -+ShdPnd: 0000000000000000 -+SigBlk: 0000000000000000 -+SigIgn: 0000000000000000 -+SigCgt: 0000000000000000 -+CapInh: 0000000000000000 -+CapPrm: 0000003fffffffff -+CapEff: 0000003fffffffff -+CapBnd: 0000003fffffffff -+Seccomp: 0 -+Cpus_allowed: ff -+Cpus_allowed_list: 0-7 -+Mems_allowed: 1 -+Mems_allowed_list: 0 -+voluntary_ctxt_switches: 1 -+nonvoluntary_ctxt_switches: 1 -diff --git a/tests/qemu-arm/sbin/dmidecode b/tests/qemu-arm/sbin/dmidecode -new file mode 100755 -index 0000000..e53c12f ---- /dev/null -+++ b/tests/qemu-arm/sbin/dmidecode -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+exit 1 -diff --git a/tests/qemu-arm/sbin/uname b/tests/qemu-arm/sbin/uname -new file mode 100755 -index 0000000..bd33a2d ---- /dev/null -+++ b/tests/qemu-arm/sbin/uname -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+echo aarch64 -diff --git a/tests/qemu-arm/sbin/virt-what-cpuid-helper b/tests/qemu-arm/sbin/virt-what-cpuid-helper -new file mode 100755 -index 0000000..77a6692 ---- /dev/null -+++ b/tests/qemu-arm/sbin/virt-what-cpuid-helper -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+# nothing -diff --git a/tests/test-lkvm-arm.sh b/tests/test-lkvm-arm.sh -new file mode 100755 -index 0000000..bed50ad ---- /dev/null -+++ b/tests/test-lkvm-arm.sh -@@ -0,0 +1,34 @@ -+# Test for LKVM on ARM -+# Copyright (C) 2015 Red Hat Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+root=tests/lkvm-arm -+ -+output="$(./virt-what --test-root=$root 2>&1)" -+expected="lkvm" -+ -+if [ "$output" != "$expected" ]; then -+ echo "$0: test failed because output did not match expected" -+ echo "Expected output was:" -+ echo "----------------------------------------" -+ echo "$expected" -+ echo "----------------------------------------" -+ echo "But the actual output of the program was:" -+ echo "----------------------------------------" -+ echo "$output" -+ echo "----------------------------------------" -+ exit 1 -+fi -diff --git a/tests/test-qemu-arm.sh b/tests/test-qemu-arm.sh -new file mode 100755 -index 0000000..58455c8 ---- /dev/null -+++ b/tests/test-qemu-arm.sh -@@ -0,0 +1,34 @@ -+# Test for qemu on ARM -+# Copyright (C) 2015 Red Hat Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+root=tests/qemu-arm -+ -+output="$(./virt-what --test-root=$root 2>&1)" -+expected="qemu" -+ -+if [ "$output" != "$expected" ]; then -+ echo "$0: test failed because output did not match expected" -+ echo "Expected output was:" -+ echo "----------------------------------------" -+ echo "$expected" -+ echo "----------------------------------------" -+ echo "But the actual output of the program was:" -+ echo "----------------------------------------" -+ echo "$output" -+ echo "----------------------------------------" -+ exit 1 -+fi -diff --git a/tests/test-xen-arm.sh b/tests/test-xen-arm.sh -new file mode 100755 -index 0000000..209712e ---- /dev/null -+++ b/tests/test-xen-arm.sh -@@ -0,0 +1,34 @@ -+# Test for Xen on ARM -+# Copyright (C) 2015 Red Hat Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+root=tests/xen-arm -+ -+output="$(./virt-what --test-root=$root 2>&1)" -+expected="xen" -+ -+if [ "$output" != "$expected" ]; then -+ echo "$0: test failed because output did not match expected" -+ echo "Expected output was:" -+ echo "----------------------------------------" -+ echo "$expected" -+ echo "----------------------------------------" -+ echo "But the actual output of the program was:" -+ echo "----------------------------------------" -+ echo "$output" -+ echo "----------------------------------------" -+ exit 1 -+fi -diff --git a/tests/xen-arm/proc/cpuinfo b/tests/xen-arm/proc/cpuinfo -new file mode 100644 -index 0000000..b83a182 ---- /dev/null -+++ b/tests/xen-arm/proc/cpuinfo -@@ -0,0 +1,63 @@ -+processor : 0 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 1 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 2 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 3 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 4 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 5 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 6 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -+ -+processor : 7 -+Features : fp asimd evtstrm -+CPU implementer : 0x50 -+CPU architecture: 8 -+CPU variant : 0x0 -+CPU part : 0x000 -+CPU revision : 0 -diff --git a/tests/xen-arm/proc/device-tree/hypervisor/compatible b/tests/xen-arm/proc/device-tree/hypervisor/compatible -new file mode 100644 -index 0000000..070f5e2 ---- /dev/null -+++ b/tests/xen-arm/proc/device-tree/hypervisor/compatible -@@ -0,0 +1 @@ -+xen,xen -diff --git a/tests/xen-arm/proc/self/status b/tests/xen-arm/proc/self/status -new file mode 100644 -index 0000000..751f5e7 ---- /dev/null -+++ b/tests/xen-arm/proc/self/status -@@ -0,0 +1,41 @@ -+Name: cat -+State: R (running) -+Tgid: 8307 -+Ngid: 0 -+Pid: 8307 -+PPid: 1415 -+TracerPid: 0 -+Uid: 0 0 0 0 -+Gid: 0 0 0 0 -+FDSize: 256 -+Groups: -+VmPeak: 109696 kB -+VmSize: 109696 kB -+VmLck: 0 kB -+VmPin: 0 kB -+VmHWM: 832 kB -+VmRSS: 832 kB -+VmData: 320 kB -+VmStk: 256 kB -+VmExe: 64 kB -+VmLib: 1536 kB -+VmPTE: 192 kB -+VmSwap: 0 kB -+Threads: 1 -+SigQ: 0/5821 -+SigPnd: 0000000000000000 -+ShdPnd: 0000000000000000 -+SigBlk: 0000000000000000 -+SigIgn: 0000000000000000 -+SigCgt: 0000000000000000 -+CapInh: 0000000000000000 -+CapPrm: 0000003fffffffff -+CapEff: 0000003fffffffff -+CapBnd: 0000003fffffffff -+Seccomp: 0 -+Cpus_allowed: ff -+Cpus_allowed_list: 0-7 -+Mems_allowed: 1 -+Mems_allowed_list: 0 -+voluntary_ctxt_switches: 1 -+nonvoluntary_ctxt_switches: 1 -diff --git a/tests/xen-arm/sbin/dmidecode b/tests/xen-arm/sbin/dmidecode -new file mode 100755 -index 0000000..e53c12f ---- /dev/null -+++ b/tests/xen-arm/sbin/dmidecode -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+exit 1 -diff --git a/tests/xen-arm/sbin/uname b/tests/xen-arm/sbin/uname -new file mode 100755 -index 0000000..bd33a2d ---- /dev/null -+++ b/tests/xen-arm/sbin/uname -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+echo aarch64 -diff --git a/tests/xen-arm/sbin/virt-what-cpuid-helper b/tests/xen-arm/sbin/virt-what-cpuid-helper -new file mode 100755 -index 0000000..77a6692 ---- /dev/null -+++ b/tests/xen-arm/sbin/virt-what-cpuid-helper -@@ -0,0 +1,2 @@ -+#!/bin/sh - -+# nothing -diff --git a/virt-what.in b/virt-what.in -index ed08dae..a5ed33e 100644 ---- a/virt-what.in -+++ b/virt-what.in -@@ -103,7 +103,7 @@ dmi=$(LANG=C dmidecode 2>&1) - # Architecture. - # Note for the purpose of testing, we only call uname with -p option. - --arch=$(uname -p) -+arch=$(uname -p | sed -e 's/i.86/i386/' | sed -e 's/arm.*/arm/') - - # Check for VMware. - # cpuid check added by Chetan Loke. -@@ -223,6 +223,13 @@ elif [ -f "${root}/sys/hypervisor/type" ] && - # enough information at present to tell whether this is dom0 - # or domU. XXX - echo xen -+elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then -+ if [ -d "${root}/proc/device-tree/hypervisor" ] && -+ grep -q "xen" "${root}/proc/device-tree/hypervisor/compatible"; then -+ echo xen -+ skip_qemu_kvm=true -+ skip_lkvm=true -+ fi - elif [ "$arch" = "ia64" ]; then - if [ -d "${root}/sys/bus/xen" -a ! -d "${root}/sys/bus/xen-backend" ]; then - # PV-on-HVM drivers installed in a Xen guest. -@@ -250,6 +257,14 @@ fi - if ! "$skip_qemu_kvm"; then - if [ "$cpuid" = "KVMKVMKVM" ]; then - echo kvm -+ elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then -+ if [ -d "${root}/proc/device-tree" ] && -+ ls "${root}/proc/device-tree" | grep -q "fw-cfg"; 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 - # option, since /proc/cpuinfo will not contain the QEMU -@@ -264,6 +279,11 @@ fi - if ! "$skip_lkvm"; then - if [ "$cpuid" = "LKVMLKVMLKVM" ]; then - echo lkvm -+ elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then -+ if [ -d "${root}/proc/device-tree" ] && -+ grep -q "dummy-virt" "${root}/proc/device-tree/compatible"; then -+ echo lkvm -+ fi - fi - fi - --- -2.3.1 - diff --git a/SOURCES/0014-Add-space-before-parens-in-function-defns-for-readab.patch b/SOURCES/0014-Add-space-before-parens-in-function-defns-for-readab.patch new file mode 100644 index 0000000..900e0b2 --- /dev/null +++ b/SOURCES/0014-Add-space-before-parens-in-function-defns-for-readab.patch @@ -0,0 +1,37 @@ +From 35852eafd298e27b9388b80ec018ffb1249f8538 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 16 Sep 2014 19:02:18 +0100 +Subject: [PATCH 14/26] Add space before parens in function defns for + readability. + +--- + virt-what.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/virt-what.in b/virt-what.in +index f2c0b90..0770070 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -33,16 +33,16 @@ skip_qemu_kvm=false + + VERSION="@VERSION@" + +-have_cpuinfo() { ++have_cpuinfo () { + test -e "${root}/proc/cpuinfo" + } + +-fail() { ++fail () { + echo "virt-what: $1" >&2 + exit 1 + } + +-usage() { ++usage () { + echo "virt-what [options]" + echo "Options:" + echo " --help Display this help" +-- +1.8.3.1 + diff --git a/SOURCES/0015-Add-lkvm-detection.patch b/SOURCES/0015-Add-lkvm-detection.patch new file mode 100644 index 0000000..b85f8db --- /dev/null +++ b/SOURCES/0015-Add-lkvm-detection.patch @@ -0,0 +1,237 @@ +From 33277fafa3892b27d3d265863d33e89ac2eea55e Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Fri, 27 Mar 2015 21:18:59 +0100 +Subject: [PATCH 15/26] Add lkvm detection + +Signed-off-by: Andrew Jones +--- + Makefile.am | 6 ++++++ + tests/lkvm/proc/cpuinfo | 19 +++++++++++++++++ + tests/lkvm/proc/self/status | 39 ++++++++++++++++++++++++++++++++++ + tests/lkvm/sbin/dmidecode | 2 ++ + tests/lkvm/sbin/uname | 2 ++ + tests/lkvm/sbin/virt-what-cpuid-helper | 2 ++ + tests/test-lkvm.sh | 34 +++++++++++++++++++++++++++++ + virt-what.in | 8 +++++++ + virt-what.pod | 8 +++++++ + 9 files changed, 120 insertions(+) + create mode 100644 tests/lkvm/proc/cpuinfo + create mode 100644 tests/lkvm/proc/self/status + create mode 100755 tests/lkvm/sbin/dmidecode + create mode 100755 tests/lkvm/sbin/uname + create mode 100755 tests/lkvm/sbin/virt-what-cpuid-helper + create mode 100755 tests/test-lkvm.sh + +diff --git a/Makefile.am b/Makefile.am +index 1c14948..46ff548 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -46,6 +46,7 @@ TESTS = \ + tests/test-kvm.sh \ + tests/test-kvm-explicit-cpu.sh \ + tests/test-linux-vserver.sh \ ++ tests/test-lkvm.sh \ + tests/test-lxc.sh \ + tests/test-lx86.sh \ + tests/test-parallels-desktop.sh \ +@@ -95,6 +96,11 @@ EXTRA_DIST = \ + tests/linux-vserver/sbin/dmidecode \ + tests/linux-vserver/sbin/uname \ + tests/linux-vserver/sbin/virt-what-cpuid-helper \ ++ tests/lkvm/proc/cpuinfo \ ++ tests/lkvm/proc/self/status \ ++ tests/lkvm/sbin/dmidecode \ ++ tests/lkvm/sbin/uname \ ++ tests/lkvm/sbin/virt-what-cpuid-helper \ + tests/lxc/proc/1/environ \ + tests/lxc/proc/cpuinfo \ + tests/lxc/proc/self/status \ +diff --git a/tests/lkvm/proc/cpuinfo b/tests/lkvm/proc/cpuinfo +new file mode 100644 +index 0000000..a53a4b9 +--- /dev/null ++++ b/tests/lkvm/proc/cpuinfo +@@ -0,0 +1,19 @@ ++processor : 0 ++vendor_id : GenuineIntel ++cpu family : 6 ++model : 15 ++model name : Intel(R) Core(TM)2 Duo CPU T7700 @ 2.40GHz ++stepping : 11 ++cpu MHz : 2659.998 ++cache size : 4096 KB ++fpu : yes ++fpu_exception : yes ++cpuid level : 10 ++wp : yes ++flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx lm constant_tsc up rep_good pni ssse3 cx16 hypervisor lahf_lm ++bogomips : 5319.99 ++clflush size : 64 ++cache_alignment : 64 ++address sizes : 40 bits physical, 48 bits virtual ++power management: ++ +diff --git a/tests/lkvm/proc/self/status b/tests/lkvm/proc/self/status +new file mode 100644 +index 0000000..264981d +--- /dev/null ++++ b/tests/lkvm/proc/self/status +@@ -0,0 +1,39 @@ ++Name: cat ++State: R (running) ++Tgid: 1618 ++Pid: 1618 ++PPid: 1609 ++TracerPid: 0 ++Uid: 0 0 0 0 ++Gid: 0 0 0 0 ++Utrace: 0 ++FDSize: 256 ++Groups: 0 1 2 3 4 6 10 ++VmPeak: 101012 kB ++VmSize: 101012 kB ++VmLck: 0 kB ++VmHWM: 472 kB ++VmRSS: 472 kB ++VmData: 184 kB ++VmStk: 136 kB ++VmExe: 44 kB ++VmLib: 1728 kB ++VmPTE: 44 kB ++VmSwap: 0 kB ++Threads: 1 ++SigQ: 0/7858 ++SigPnd: 0000000000000000 ++ShdPnd: 0000000000000000 ++SigBlk: 0000000000000000 ++SigIgn: 0000000000000000 ++SigCgt: 0000000000000000 ++CapInh: 0000000000000000 ++CapPrm: ffffffffffffffff ++CapEff: ffffffffffffffff ++CapBnd: ffffffffffffffff ++Cpus_allowed: 1 ++Cpus_allowed_list: 0 ++Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 ++Mems_allowed_list: 0 ++voluntary_ctxt_switches: 0 ++nonvoluntary_ctxt_switches: 1 +diff --git a/tests/lkvm/sbin/dmidecode b/tests/lkvm/sbin/dmidecode +new file mode 100755 +index 0000000..e53c12f +--- /dev/null ++++ b/tests/lkvm/sbin/dmidecode +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++exit 1 +diff --git a/tests/lkvm/sbin/uname b/tests/lkvm/sbin/uname +new file mode 100755 +index 0000000..ab0ec89 +--- /dev/null ++++ b/tests/lkvm/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo x86_64 +diff --git a/tests/lkvm/sbin/virt-what-cpuid-helper b/tests/lkvm/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..2b068cd +--- /dev/null ++++ b/tests/lkvm/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo LKVMLKVMLKVM +diff --git a/tests/test-lkvm.sh b/tests/test-lkvm.sh +new file mode 100755 +index 0000000..6eb326c +--- /dev/null ++++ b/tests/test-lkvm.sh +@@ -0,0 +1,34 @@ ++# Test for LKVM ++# Copyright (C) 2015 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++root=tests/lkvm ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="lkvm" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/virt-what.in b/virt-what.in +index 0770070..ed08dae 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -30,6 +30,7 @@ + set -u + root='' + skip_qemu_kvm=false ++skip_lkvm=false + + VERSION="@VERSION@" + +@@ -215,6 +216,7 @@ elif [ -d "${root}/proc/xen" ]; then + echo xen-domU + fi + skip_qemu_kvm=true ++ skip_lkvm=true + elif [ -f "${root}/sys/hypervisor/type" ] && + grep -q "xen" "${root}/sys/hypervisor/type"; then + # Ordinary kernel with pv_ops. There does not seem to be +@@ -259,6 +261,12 @@ if ! "$skip_qemu_kvm"; then + fi + fi + ++if ! "$skip_lkvm"; then ++ if [ "$cpuid" = "LKVMLKVMLKVM" ]; then ++ echo lkvm ++ fi ++fi ++ + # Check for Docker. + if [ -f "${root}/.dockerinit" ]; then + echo docker +diff --git a/virt-what.pod b/virt-what.pod +index 8fd9bc4..0e2e8a5 100644 +--- a/virt-what.pod ++++ b/virt-what.pod +@@ -101,6 +101,14 @@ instead. + + Status: confirmed by RWMJ. + ++=item B ++ ++This guest is running on the KVM hypervisor using hardware ++acceleration, and the userspace component of the hypervisor ++is lkvm (a.k.a kvmtool). ++ ++Status: contributed by Andrew Jones ++ + =item B + + The guest appears to be running inside an OpenVZ or Virtuozzo +-- +1.8.3.1 + diff --git a/SOURCES/0015-xen-arm-Fix-path-in-EXTRA_DIST.patch b/SOURCES/0015-xen-arm-Fix-path-in-EXTRA_DIST.patch deleted file mode 100644 index 277bf28..0000000 --- a/SOURCES/0015-xen-arm-Fix-path-in-EXTRA_DIST.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 5c4bdcf6abe012dbc4965e5bede00c8a9d31a8f6 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 21 Apr 2015 12:12:45 +0100 -Subject: [PATCH 15/16] xen-arm: Fix path in EXTRA_DIST. - ---- - Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.am b/Makefile.am -index 514d229..8a47e96 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -201,7 +201,7 @@ EXTRA_DIST = \ - tests/rhel5-xen-domU-pv/sys/hypervisor/compilation/compile_date \ - tests/rhel5-xen-domU-pv/sys/hypervisor/uuid \ - tests/xen-arm/proc/cpuinfo \ -- tests/xen-arm/proc/device-tree/compatible \ -+ tests/xen-arm/proc/device-tree/hypervisor/compatible \ - tests/xen-arm/proc/self/status \ - tests/xen-arm/sbin/dmidecode \ - tests/xen-arm/sbin/uname \ --- -2.3.1 - diff --git a/SOURCES/0016-Add-ARM-support.patch b/SOURCES/0016-Add-ARM-support.patch new file mode 100644 index 0000000..6d4d75f --- /dev/null +++ b/SOURCES/0016-Add-ARM-support.patch @@ -0,0 +1,736 @@ +From b87a2d79ce8c5eee3a2f945b8eb00d893104fd10 Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Fri, 27 Mar 2015 21:19:00 +0100 +Subject: [PATCH 16/26] Add ARM support + +Currently only detects LKVM, QEMU/KVM, and Xen. Also only works if +the guest is booted with DT (which is the only way that currently +exists). + +Signed-off-by: Andrew Jones +--- + Makefile.am | 21 ++++++++ + tests/lkvm-arm/proc/cpuinfo | 63 ++++++++++++++++++++++ + tests/lkvm-arm/proc/device-tree/compatible | 1 + + tests/lkvm-arm/proc/self/status | 41 ++++++++++++++ + tests/lkvm-arm/sbin/dmidecode | 2 + + tests/lkvm-arm/sbin/uname | 2 + + tests/lkvm-arm/sbin/virt-what-cpuid-helper | 2 + + tests/qemu-arm/proc/cpuinfo | 63 ++++++++++++++++++++++ + .../proc/device-tree/fw-cfg@9020000/compatible | 1 + + tests/qemu-arm/proc/self/status | 41 ++++++++++++++ + tests/qemu-arm/sbin/dmidecode | 2 + + tests/qemu-arm/sbin/uname | 2 + + tests/qemu-arm/sbin/virt-what-cpuid-helper | 2 + + tests/test-lkvm-arm.sh | 34 ++++++++++++ + tests/test-qemu-arm.sh | 34 ++++++++++++ + tests/test-xen-arm.sh | 34 ++++++++++++ + tests/xen-arm/proc/cpuinfo | 63 ++++++++++++++++++++++ + .../xen-arm/proc/device-tree/hypervisor/compatible | 1 + + tests/xen-arm/proc/self/status | 41 ++++++++++++++ + tests/xen-arm/sbin/dmidecode | 2 + + tests/xen-arm/sbin/uname | 2 + + tests/xen-arm/sbin/virt-what-cpuid-helper | 2 + + virt-what.in | 22 +++++++- + 23 files changed, 477 insertions(+), 1 deletion(-) + create mode 100644 tests/lkvm-arm/proc/cpuinfo + create mode 100644 tests/lkvm-arm/proc/device-tree/compatible + create mode 100644 tests/lkvm-arm/proc/self/status + create mode 100755 tests/lkvm-arm/sbin/dmidecode + create mode 100755 tests/lkvm-arm/sbin/uname + create mode 100755 tests/lkvm-arm/sbin/virt-what-cpuid-helper + create mode 100644 tests/qemu-arm/proc/cpuinfo + create mode 100644 tests/qemu-arm/proc/device-tree/fw-cfg@9020000/compatible + create mode 100644 tests/qemu-arm/proc/self/status + create mode 100755 tests/qemu-arm/sbin/dmidecode + create mode 100755 tests/qemu-arm/sbin/uname + create mode 100755 tests/qemu-arm/sbin/virt-what-cpuid-helper + create mode 100755 tests/test-lkvm-arm.sh + create mode 100755 tests/test-qemu-arm.sh + create mode 100755 tests/test-xen-arm.sh + create mode 100644 tests/xen-arm/proc/cpuinfo + create mode 100644 tests/xen-arm/proc/device-tree/hypervisor/compatible + create mode 100644 tests/xen-arm/proc/self/status + create mode 100755 tests/xen-arm/sbin/dmidecode + create mode 100755 tests/xen-arm/sbin/uname + create mode 100755 tests/xen-arm/sbin/virt-what-cpuid-helper + +diff --git a/Makefile.am b/Makefile.am +index 46ff548..514d229 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -47,14 +47,17 @@ TESTS = \ + tests/test-kvm-explicit-cpu.sh \ + tests/test-linux-vserver.sh \ + tests/test-lkvm.sh \ ++ tests/test-lkvm-arm.sh \ + tests/test-lxc.sh \ + tests/test-lx86.sh \ + tests/test-parallels-desktop.sh \ + tests/test-qemu.sh \ ++ tests/test-qemu-arm.sh \ + tests/test-rhel5-xen-dom0.sh \ + tests/test-rhel5-xen-domU-hvm.sh \ + tests/test-rhel5-xen-domU-hvm-ia64.sh \ + tests/test-rhel5-xen-domU-pv.sh \ ++ tests/test-xen-arm.sh \ + tests/test-zvm.sh + + EXTRA_DIST = \ +@@ -101,6 +104,12 @@ EXTRA_DIST = \ + tests/lkvm/sbin/dmidecode \ + tests/lkvm/sbin/uname \ + tests/lkvm/sbin/virt-what-cpuid-helper \ ++ tests/lkvm-arm/proc/cpuinfo \ ++ tests/lkvm-arm/proc/device-tree/compatible \ ++ tests/lkvm-arm/proc/self/status \ ++ tests/lkvm-arm/sbin/dmidecode \ ++ tests/lkvm-arm/sbin/uname \ ++ tests/lkvm-arm/sbin/virt-what-cpuid-helper \ + tests/lxc/proc/1/environ \ + tests/lxc/proc/cpuinfo \ + tests/lxc/proc/self/status \ +@@ -122,6 +131,12 @@ EXTRA_DIST = \ + tests/qemu/sbin/dmidecode \ + tests/qemu/sbin/uname \ + tests/qemu/sbin/virt-what-cpuid-helper \ ++ tests/qemu-arm/proc/cpuinfo \ ++ tests/qemu-arm/proc/device-tree/fw-cfg@9020000/compatible \ ++ tests/qemu-arm/proc/self/status \ ++ tests/qemu-arm/sbin/dmidecode \ ++ tests/qemu-arm/sbin/uname \ ++ tests/qemu-arm/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 \ +@@ -185,6 +200,12 @@ EXTRA_DIST = \ + tests/rhel5-xen-domU-pv/sys/hypervisor/compilation/compiled_by \ + tests/rhel5-xen-domU-pv/sys/hypervisor/compilation/compile_date \ + tests/rhel5-xen-domU-pv/sys/hypervisor/uuid \ ++ tests/xen-arm/proc/cpuinfo \ ++ tests/xen-arm/proc/device-tree/compatible \ ++ tests/xen-arm/proc/self/status \ ++ tests/xen-arm/sbin/dmidecode \ ++ tests/xen-arm/sbin/uname \ ++ tests/xen-arm/sbin/virt-what-cpuid-helper \ + tests/zvm/proc/cpuinfo \ + tests/zvm/proc/self/status \ + tests/zvm/proc/sysinfo \ +diff --git a/tests/lkvm-arm/proc/cpuinfo b/tests/lkvm-arm/proc/cpuinfo +new file mode 100644 +index 0000000..b83a182 +--- /dev/null ++++ b/tests/lkvm-arm/proc/cpuinfo +@@ -0,0 +1,63 @@ ++processor : 0 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 1 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 2 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 3 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 4 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 5 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 6 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 7 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 +diff --git a/tests/lkvm-arm/proc/device-tree/compatible b/tests/lkvm-arm/proc/device-tree/compatible +new file mode 100644 +index 0000000..99642ed +--- /dev/null ++++ b/tests/lkvm-arm/proc/device-tree/compatible +@@ -0,0 +1 @@ ++linux,dummy-virt +diff --git a/tests/lkvm-arm/proc/self/status b/tests/lkvm-arm/proc/self/status +new file mode 100644 +index 0000000..751f5e7 +--- /dev/null ++++ b/tests/lkvm-arm/proc/self/status +@@ -0,0 +1,41 @@ ++Name: cat ++State: R (running) ++Tgid: 8307 ++Ngid: 0 ++Pid: 8307 ++PPid: 1415 ++TracerPid: 0 ++Uid: 0 0 0 0 ++Gid: 0 0 0 0 ++FDSize: 256 ++Groups: ++VmPeak: 109696 kB ++VmSize: 109696 kB ++VmLck: 0 kB ++VmPin: 0 kB ++VmHWM: 832 kB ++VmRSS: 832 kB ++VmData: 320 kB ++VmStk: 256 kB ++VmExe: 64 kB ++VmLib: 1536 kB ++VmPTE: 192 kB ++VmSwap: 0 kB ++Threads: 1 ++SigQ: 0/5821 ++SigPnd: 0000000000000000 ++ShdPnd: 0000000000000000 ++SigBlk: 0000000000000000 ++SigIgn: 0000000000000000 ++SigCgt: 0000000000000000 ++CapInh: 0000000000000000 ++CapPrm: 0000003fffffffff ++CapEff: 0000003fffffffff ++CapBnd: 0000003fffffffff ++Seccomp: 0 ++Cpus_allowed: ff ++Cpus_allowed_list: 0-7 ++Mems_allowed: 1 ++Mems_allowed_list: 0 ++voluntary_ctxt_switches: 1 ++nonvoluntary_ctxt_switches: 1 +diff --git a/tests/lkvm-arm/sbin/dmidecode b/tests/lkvm-arm/sbin/dmidecode +new file mode 100755 +index 0000000..e53c12f +--- /dev/null ++++ b/tests/lkvm-arm/sbin/dmidecode +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++exit 1 +diff --git a/tests/lkvm-arm/sbin/uname b/tests/lkvm-arm/sbin/uname +new file mode 100755 +index 0000000..bd33a2d +--- /dev/null ++++ b/tests/lkvm-arm/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo aarch64 +diff --git a/tests/lkvm-arm/sbin/virt-what-cpuid-helper b/tests/lkvm-arm/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..77a6692 +--- /dev/null ++++ b/tests/lkvm-arm/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++# nothing +diff --git a/tests/qemu-arm/proc/cpuinfo b/tests/qemu-arm/proc/cpuinfo +new file mode 100644 +index 0000000..b83a182 +--- /dev/null ++++ b/tests/qemu-arm/proc/cpuinfo +@@ -0,0 +1,63 @@ ++processor : 0 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 1 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 2 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 3 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 4 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 5 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 6 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 7 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 +diff --git a/tests/qemu-arm/proc/device-tree/fw-cfg@9020000/compatible b/tests/qemu-arm/proc/device-tree/fw-cfg@9020000/compatible +new file mode 100644 +index 0000000..3932ade +--- /dev/null ++++ b/tests/qemu-arm/proc/device-tree/fw-cfg@9020000/compatible +@@ -0,0 +1 @@ ++qemu,fw-cfg-mmio +diff --git a/tests/qemu-arm/proc/self/status b/tests/qemu-arm/proc/self/status +new file mode 100644 +index 0000000..751f5e7 +--- /dev/null ++++ b/tests/qemu-arm/proc/self/status +@@ -0,0 +1,41 @@ ++Name: cat ++State: R (running) ++Tgid: 8307 ++Ngid: 0 ++Pid: 8307 ++PPid: 1415 ++TracerPid: 0 ++Uid: 0 0 0 0 ++Gid: 0 0 0 0 ++FDSize: 256 ++Groups: ++VmPeak: 109696 kB ++VmSize: 109696 kB ++VmLck: 0 kB ++VmPin: 0 kB ++VmHWM: 832 kB ++VmRSS: 832 kB ++VmData: 320 kB ++VmStk: 256 kB ++VmExe: 64 kB ++VmLib: 1536 kB ++VmPTE: 192 kB ++VmSwap: 0 kB ++Threads: 1 ++SigQ: 0/5821 ++SigPnd: 0000000000000000 ++ShdPnd: 0000000000000000 ++SigBlk: 0000000000000000 ++SigIgn: 0000000000000000 ++SigCgt: 0000000000000000 ++CapInh: 0000000000000000 ++CapPrm: 0000003fffffffff ++CapEff: 0000003fffffffff ++CapBnd: 0000003fffffffff ++Seccomp: 0 ++Cpus_allowed: ff ++Cpus_allowed_list: 0-7 ++Mems_allowed: 1 ++Mems_allowed_list: 0 ++voluntary_ctxt_switches: 1 ++nonvoluntary_ctxt_switches: 1 +diff --git a/tests/qemu-arm/sbin/dmidecode b/tests/qemu-arm/sbin/dmidecode +new file mode 100755 +index 0000000..e53c12f +--- /dev/null ++++ b/tests/qemu-arm/sbin/dmidecode +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++exit 1 +diff --git a/tests/qemu-arm/sbin/uname b/tests/qemu-arm/sbin/uname +new file mode 100755 +index 0000000..bd33a2d +--- /dev/null ++++ b/tests/qemu-arm/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo aarch64 +diff --git a/tests/qemu-arm/sbin/virt-what-cpuid-helper b/tests/qemu-arm/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..77a6692 +--- /dev/null ++++ b/tests/qemu-arm/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++# nothing +diff --git a/tests/test-lkvm-arm.sh b/tests/test-lkvm-arm.sh +new file mode 100755 +index 0000000..bed50ad +--- /dev/null ++++ b/tests/test-lkvm-arm.sh +@@ -0,0 +1,34 @@ ++# Test for LKVM on ARM ++# Copyright (C) 2015 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++root=tests/lkvm-arm ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="lkvm" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/tests/test-qemu-arm.sh b/tests/test-qemu-arm.sh +new file mode 100755 +index 0000000..58455c8 +--- /dev/null ++++ b/tests/test-qemu-arm.sh +@@ -0,0 +1,34 @@ ++# Test for qemu on ARM ++# Copyright (C) 2015 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++root=tests/qemu-arm ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="qemu" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/tests/test-xen-arm.sh b/tests/test-xen-arm.sh +new file mode 100755 +index 0000000..209712e +--- /dev/null ++++ b/tests/test-xen-arm.sh +@@ -0,0 +1,34 @@ ++# Test for Xen on ARM ++# Copyright (C) 2015 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++root=tests/xen-arm ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="xen" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/tests/xen-arm/proc/cpuinfo b/tests/xen-arm/proc/cpuinfo +new file mode 100644 +index 0000000..b83a182 +--- /dev/null ++++ b/tests/xen-arm/proc/cpuinfo +@@ -0,0 +1,63 @@ ++processor : 0 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 1 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 2 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 3 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 4 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 5 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 6 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 7 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 +diff --git a/tests/xen-arm/proc/device-tree/hypervisor/compatible b/tests/xen-arm/proc/device-tree/hypervisor/compatible +new file mode 100644 +index 0000000..070f5e2 +--- /dev/null ++++ b/tests/xen-arm/proc/device-tree/hypervisor/compatible +@@ -0,0 +1 @@ ++xen,xen +diff --git a/tests/xen-arm/proc/self/status b/tests/xen-arm/proc/self/status +new file mode 100644 +index 0000000..751f5e7 +--- /dev/null ++++ b/tests/xen-arm/proc/self/status +@@ -0,0 +1,41 @@ ++Name: cat ++State: R (running) ++Tgid: 8307 ++Ngid: 0 ++Pid: 8307 ++PPid: 1415 ++TracerPid: 0 ++Uid: 0 0 0 0 ++Gid: 0 0 0 0 ++FDSize: 256 ++Groups: ++VmPeak: 109696 kB ++VmSize: 109696 kB ++VmLck: 0 kB ++VmPin: 0 kB ++VmHWM: 832 kB ++VmRSS: 832 kB ++VmData: 320 kB ++VmStk: 256 kB ++VmExe: 64 kB ++VmLib: 1536 kB ++VmPTE: 192 kB ++VmSwap: 0 kB ++Threads: 1 ++SigQ: 0/5821 ++SigPnd: 0000000000000000 ++ShdPnd: 0000000000000000 ++SigBlk: 0000000000000000 ++SigIgn: 0000000000000000 ++SigCgt: 0000000000000000 ++CapInh: 0000000000000000 ++CapPrm: 0000003fffffffff ++CapEff: 0000003fffffffff ++CapBnd: 0000003fffffffff ++Seccomp: 0 ++Cpus_allowed: ff ++Cpus_allowed_list: 0-7 ++Mems_allowed: 1 ++Mems_allowed_list: 0 ++voluntary_ctxt_switches: 1 ++nonvoluntary_ctxt_switches: 1 +diff --git a/tests/xen-arm/sbin/dmidecode b/tests/xen-arm/sbin/dmidecode +new file mode 100755 +index 0000000..e53c12f +--- /dev/null ++++ b/tests/xen-arm/sbin/dmidecode +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++exit 1 +diff --git a/tests/xen-arm/sbin/uname b/tests/xen-arm/sbin/uname +new file mode 100755 +index 0000000..bd33a2d +--- /dev/null ++++ b/tests/xen-arm/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo aarch64 +diff --git a/tests/xen-arm/sbin/virt-what-cpuid-helper b/tests/xen-arm/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..77a6692 +--- /dev/null ++++ b/tests/xen-arm/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++# nothing +diff --git a/virt-what.in b/virt-what.in +index ed08dae..a5ed33e 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -103,7 +103,7 @@ dmi=$(LANG=C dmidecode 2>&1) + # Architecture. + # Note for the purpose of testing, we only call uname with -p option. + +-arch=$(uname -p) ++arch=$(uname -p | sed -e 's/i.86/i386/' | sed -e 's/arm.*/arm/') + + # Check for VMware. + # cpuid check added by Chetan Loke. +@@ -223,6 +223,13 @@ elif [ -f "${root}/sys/hypervisor/type" ] && + # enough information at present to tell whether this is dom0 + # or domU. XXX + echo xen ++elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then ++ if [ -d "${root}/proc/device-tree/hypervisor" ] && ++ grep -q "xen" "${root}/proc/device-tree/hypervisor/compatible"; then ++ echo xen ++ skip_qemu_kvm=true ++ skip_lkvm=true ++ fi + elif [ "$arch" = "ia64" ]; then + if [ -d "${root}/sys/bus/xen" -a ! -d "${root}/sys/bus/xen-backend" ]; then + # PV-on-HVM drivers installed in a Xen guest. +@@ -250,6 +257,14 @@ fi + if ! "$skip_qemu_kvm"; then + if [ "$cpuid" = "KVMKVMKVM" ]; then + echo kvm ++ elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then ++ if [ -d "${root}/proc/device-tree" ] && ++ ls "${root}/proc/device-tree" | grep -q "fw-cfg"; 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 + # option, since /proc/cpuinfo will not contain the QEMU +@@ -264,6 +279,11 @@ fi + if ! "$skip_lkvm"; then + if [ "$cpuid" = "LKVMLKVMLKVM" ]; then + echo lkvm ++ elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then ++ if [ -d "${root}/proc/device-tree" ] && ++ grep -q "dummy-virt" "${root}/proc/device-tree/compatible"; then ++ echo lkvm ++ fi + fi + fi + +-- +1.8.3.1 + diff --git a/SOURCES/0017-xen-arm-Fix-path-in-EXTRA_DIST.patch b/SOURCES/0017-xen-arm-Fix-path-in-EXTRA_DIST.patch new file mode 100644 index 0000000..fbfb152 --- /dev/null +++ b/SOURCES/0017-xen-arm-Fix-path-in-EXTRA_DIST.patch @@ -0,0 +1,25 @@ +From ac098dd1513370145f10d6dd7c147b45168ef6a0 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 21 Apr 2015 12:12:45 +0100 +Subject: [PATCH 17/26] xen-arm: Fix path in EXTRA_DIST. + +--- + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index 514d229..8a47e96 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -201,7 +201,7 @@ EXTRA_DIST = \ + tests/rhel5-xen-domU-pv/sys/hypervisor/compilation/compile_date \ + tests/rhel5-xen-domU-pv/sys/hypervisor/uuid \ + tests/xen-arm/proc/cpuinfo \ +- tests/xen-arm/proc/device-tree/compatible \ ++ tests/xen-arm/proc/device-tree/hypervisor/compatible \ + tests/xen-arm/proc/self/status \ + tests/xen-arm/sbin/dmidecode \ + tests/xen-arm/sbin/uname \ +-- +1.8.3.1 + diff --git a/SOURCES/0018-Update-copyright-years.patch b/SOURCES/0018-Update-copyright-years.patch new file mode 100644 index 0000000..69b13c6 --- /dev/null +++ b/SOURCES/0018-Update-copyright-years.patch @@ -0,0 +1,38 @@ +From e70023e026f0abd820e9702f7a3c745e03c2846d Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 3 Aug 2015 12:23:05 +0100 +Subject: [PATCH 18/26] Update copyright years. + +--- + virt-what.in | 2 +- + virt-what.pod | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/virt-what.in b/virt-what.in +index a5ed33e..6daba34 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -1,6 +1,6 @@ + #!/bin/sh - + # @configure_input@ +-# Copyright (C) 2008-2011 Red Hat Inc. ++# Copyright (C) 2008-2015 Red Hat Inc. + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +diff --git a/virt-what.pod b/virt-what.pod +index 0e2e8a5..d936e4a 100644 +--- a/virt-what.pod ++++ b/virt-what.pod +@@ -286,7 +286,7 @@ Richard W.M. Jones + + =head1 COPYRIGHT + +-(C) Copyright 2008-2011 Red Hat Inc., ++(C) Copyright 2008-2015 Red Hat Inc., + L + + This program is free software; you can redistribute it and/or modify +-- +1.8.3.1 + diff --git a/SOURCES/0019-Add-QEMU-KVM-detection-for-ACPI-boot-ARM.patch b/SOURCES/0019-Add-QEMU-KVM-detection-for-ACPI-boot-ARM.patch new file mode 100644 index 0000000..4b47e68 --- /dev/null +++ b/SOURCES/0019-Add-QEMU-KVM-detection-for-ACPI-boot-ARM.patch @@ -0,0 +1,389 @@ +From c722083f37e514f4d8b9f9470536dcbae428631a Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Tue, 22 Sep 2015 15:54:55 +0200 +Subject: [PATCH 19/26] Add QEMU/KVM detection for ACPI-boot ARM + +Detect QEMU/KVM on ARM guests that have been boot with ACPI, i.e. +without device tree. When boot with ACPI SMBIOS is populated, so we +can use dmidecode. + +Signed-off-by: Andrew Jones +--- + Makefile.am | 6 + + tests/qemu-arm-acpi/proc/cpuinfo | 63 +++++++++++ + tests/qemu-arm-acpi/proc/self/status | 41 +++++++ + tests/qemu-arm-acpi/sbin/dmidecode | 141 ++++++++++++++++++++++++ + tests/qemu-arm-acpi/sbin/uname | 2 + + tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper | 2 + + tests/test-qemu-arm-acpi.sh | 34 ++++++ + virt-what.in | 5 + + 8 files changed, 294 insertions(+) + create mode 100644 tests/qemu-arm-acpi/proc/cpuinfo + create mode 100644 tests/qemu-arm-acpi/proc/self/status + create mode 100755 tests/qemu-arm-acpi/sbin/dmidecode + create mode 100755 tests/qemu-arm-acpi/sbin/uname + create mode 100755 tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper + create mode 100755 tests/test-qemu-arm-acpi.sh + +diff --git a/Makefile.am b/Makefile.am +index 8a47e96..2c958ca 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -53,6 +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-rhel5-xen-dom0.sh \ + tests/test-rhel5-xen-domU-hvm.sh \ + tests/test-rhel5-xen-domU-hvm-ia64.sh \ +@@ -137,6 +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/rhel5-xen-dom0/proc/cpuinfo \ + tests/rhel5-xen-dom0/proc/self/status \ + tests/rhel5-xen-dom0/proc/xen/balloon \ +diff --git a/tests/qemu-arm-acpi/proc/cpuinfo b/tests/qemu-arm-acpi/proc/cpuinfo +new file mode 100644 +index 0000000..b83a182 +--- /dev/null ++++ b/tests/qemu-arm-acpi/proc/cpuinfo +@@ -0,0 +1,63 @@ ++processor : 0 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 1 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 2 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 3 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 4 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 5 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 6 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 7 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 +diff --git a/tests/qemu-arm-acpi/proc/self/status b/tests/qemu-arm-acpi/proc/self/status +new file mode 100644 +index 0000000..751f5e7 +--- /dev/null ++++ b/tests/qemu-arm-acpi/proc/self/status +@@ -0,0 +1,41 @@ ++Name: cat ++State: R (running) ++Tgid: 8307 ++Ngid: 0 ++Pid: 8307 ++PPid: 1415 ++TracerPid: 0 ++Uid: 0 0 0 0 ++Gid: 0 0 0 0 ++FDSize: 256 ++Groups: ++VmPeak: 109696 kB ++VmSize: 109696 kB ++VmLck: 0 kB ++VmPin: 0 kB ++VmHWM: 832 kB ++VmRSS: 832 kB ++VmData: 320 kB ++VmStk: 256 kB ++VmExe: 64 kB ++VmLib: 1536 kB ++VmPTE: 192 kB ++VmSwap: 0 kB ++Threads: 1 ++SigQ: 0/5821 ++SigPnd: 0000000000000000 ++ShdPnd: 0000000000000000 ++SigBlk: 0000000000000000 ++SigIgn: 0000000000000000 ++SigCgt: 0000000000000000 ++CapInh: 0000000000000000 ++CapPrm: 0000003fffffffff ++CapEff: 0000003fffffffff ++CapBnd: 0000003fffffffff ++Seccomp: 0 ++Cpus_allowed: ff ++Cpus_allowed_list: 0-7 ++Mems_allowed: 1 ++Mems_allowed_list: 0 ++voluntary_ctxt_switches: 1 ++nonvoluntary_ctxt_switches: 1 +diff --git a/tests/qemu-arm-acpi/sbin/dmidecode b/tests/qemu-arm-acpi/sbin/dmidecode +new file mode 100755 +index 0000000..f7ffd4b +--- /dev/null ++++ b/tests/qemu-arm-acpi/sbin/dmidecode +@@ -0,0 +1,141 @@ ++#!/bin/sh - ++cat <<'EOF' ++# dmidecode 3.0 ++Getting SMBIOS data from sysfs. ++SMBIOS 3.0.0 present. ++Table at 0x136650000. ++ ++Handle 0x0100, DMI type 1, 27 bytes ++System Information ++ Manufacturer: QEMU ++ Product Name: QEMU Virtual Machine ++ Version: 1.0 ++ Serial Number: Not Specified ++ UUID: 6EB70381-DF9C-4407-B6AB-9FA4452117EA ++ Wake-up Type: Power Switch ++ SKU Number: Not Specified ++ Family: Red Hat Enterprise Linux ++ ++Handle 0x0300, DMI type 3, 21 bytes ++Chassis Information ++ Manufacturer: QEMU ++ Type: Other ++ Lock: Not Present ++ Version: 1.0 ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Boot-up State: Safe ++ Power Supply State: Safe ++ Thermal State: Safe ++ Security Status: Unknown ++ OEM Information: 0x00000000 ++ Height: Unspecified ++ Number Of Power Cords: Unspecified ++ Contained Elements: 0 ++ ++Handle 0x0400, DMI type 4, 42 bytes ++Processor Information ++ Socket Designation: CPU 0 ++ Type: Central Processor ++ Family: Other ++ Manufacturer: QEMU ++ ID: 00 00 00 00 00 00 00 00 ++ Version: 1.0 ++ Voltage: Unknown ++ External Clock: Unknown ++ Max Speed: 2000 MHz ++ Current Speed: 2000 MHz ++ Status: Populated, Enabled ++ Upgrade: Other ++ L1 Cache Handle: Not Provided ++ L2 Cache Handle: Not Provided ++ L3 Cache Handle: Not Provided ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Part Number: Not Specified ++ Core Count: 1 ++ Core Enabled: 1 ++ Thread Count: 1 ++ Characteristics: None ++ ++Handle 0x0401, DMI type 4, 42 bytes ++Processor Information ++ Socket Designation: CPU 1 ++ Type: Central Processor ++ Family: Other ++ Manufacturer: QEMU ++ ID: 00 00 00 00 00 00 00 00 ++ Version: 1.0 ++ Voltage: Unknown ++ External Clock: Unknown ++ Max Speed: 2000 MHz ++ Current Speed: 2000 MHz ++ Status: Populated, Enabled ++ Upgrade: Other ++ L1 Cache Handle: Not Provided ++ L2 Cache Handle: Not Provided ++ L3 Cache Handle: Not Provided ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Part Number: Not Specified ++ Core Count: 1 ++ Core Enabled: 1 ++ Thread Count: 1 ++ Characteristics: None ++ ++Handle 0x1000, DMI type 16, 23 bytes ++Physical Memory Array ++ Location: Other ++ Use: System Memory ++ Error Correction Type: Multi-bit ECC ++ Maximum Capacity: 4 GB ++ Error Information Handle: Not Provided ++ Number Of Devices: 1 ++ ++Handle 0x1100, DMI type 17, 40 bytes ++Memory Device ++ Array Handle: 0x1000 ++ Error Information Handle: Not Provided ++ Total Width: Unknown ++ Data Width: Unknown ++ Size: 4096 MB ++ Form Factor: DIMM ++ Set: None ++ Locator: DIMM 0 ++ Bank Locator: Not Specified ++ Type: RAM ++ Type Detail: Other ++ Speed: Unknown ++ Manufacturer: QEMU ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Part Number: Not Specified ++ Rank: Unknown ++ Configured Clock Speed: Unknown ++ Minimum Voltage: Unknown ++ Maximum Voltage: Unknown ++ Configured Voltage: Unknown ++ ++Handle 0x2000, DMI type 32, 11 bytes ++System Boot Information ++ Status: No errors detected ++ ++Handle 0x0000, DMI type 0, 24 bytes ++BIOS Information ++ Vendor: EFI Development Kit II / OVMF ++ Version: 0.0.0 ++ Release Date: 02/06/2015 ++ Address: 0xE8000 ++ Runtime Size: 96 kB ++ ROM Size: 64 kB ++ Characteristics: ++ BIOS characteristics not supported ++ Targeted content distribution is supported ++ UEFI is supported ++ System is a virtual machine ++ BIOS Revision: 0.0 ++ ++Handle 0xFEFF, DMI type 127, 4 bytes ++End Of Table ++ ++EOF +diff --git a/tests/qemu-arm-acpi/sbin/uname b/tests/qemu-arm-acpi/sbin/uname +new file mode 100755 +index 0000000..bd33a2d +--- /dev/null ++++ b/tests/qemu-arm-acpi/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo aarch64 +diff --git a/tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper b/tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..77a6692 +--- /dev/null ++++ b/tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++# nothing +diff --git a/tests/test-qemu-arm-acpi.sh b/tests/test-qemu-arm-acpi.sh +new file mode 100755 +index 0000000..64db9eb +--- /dev/null ++++ b/tests/test-qemu-arm-acpi.sh +@@ -0,0 +1,34 @@ ++# Test for qemu on ARM ++# Copyright (C) 2015 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# 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 ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="qemu" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/virt-what.in b/virt-what.in +index 6daba34..697595c 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -264,6 +264,11 @@ 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 +-- +1.8.3.1 + diff --git a/SOURCES/0020-trivial-comment-fixup.patch b/SOURCES/0020-trivial-comment-fixup.patch new file mode 100644 index 0000000..8e492ad --- /dev/null +++ b/SOURCES/0020-trivial-comment-fixup.patch @@ -0,0 +1,30 @@ +From fd9a0ea54fa254f880039a64f0ae68da1a5af1ff Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Tue, 22 Sep 2015 18:29:08 +0200 +Subject: [PATCH 20/26] trivial: comment fixup + +dmidecode does now exist on non-PC architectures. +--- + virt-what.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/virt-what.in b/virt-what.in +index 697595c..2de040a 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -94,9 +94,9 @@ fi + cpuid=$(virt-what-cpuid-helper) + + # Check for various products in the BIOS information. +-# Note that dmidecode doesn't exist on non-PC architectures. On these, +-# this will return an error which is ignored (error message redirected +-# into $dmi variable). ++# Note that dmidecode doesn't exist on all architectures. On the ones ++# it does not, then this will return an error, which is ignored (error ++# message redirected into the $dmi variable). + + dmi=$(LANG=C dmidecode 2>&1) + +-- +1.8.3.1 + diff --git a/SOURCES/0021-Add-oVirt-RHBZ-1249438.patch b/SOURCES/0021-Add-oVirt-RHBZ-1249438.patch new file mode 100644 index 0000000..030ba56 --- /dev/null +++ b/SOURCES/0021-Add-oVirt-RHBZ-1249438.patch @@ -0,0 +1,46 @@ +From 74d099109217f7a4c0ec9790c6e83df392f4a5ae Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 3 Aug 2015 12:23:13 +0100 +Subject: [PATCH 21/26] Add oVirt (RHBZ#1249438). + +--- + virt-what.in | 5 +++++ + virt-what.pod | 6 ++++++ + 2 files changed, 11 insertions(+) + +diff --git a/virt-what.in b/virt-what.in +index 2de040a..d37da85 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -203,6 +203,11 @@ if echo "$dmi" | grep -q 'Vendor: Parallels'; then + skip_qemu_kvm=true + fi + ++# Check for oVirt. ++if echo "$dmi" | grep -q 'Manufacturer: oVirt'; then ++ echo ovirt ++fi ++ + # Check for Xen. + + if [ "$cpuid" = "XenVMMXenVMM" ]; then +diff --git a/virt-what.pod b/virt-what.pod +index d936e4a..4e38414 100644 +--- a/virt-what.pod ++++ b/virt-what.pod +@@ -116,6 +116,12 @@ container. + + Status: contributed by Evgeniy Sokolov + ++=item B ++ ++The guest is running on an oVirt or RHEV node. ++ ++Status: contributed by RWMJ, not confirmed ++ + =item B + + The guest is running inside Parallels Virtual Platform +-- +1.8.3.1 + diff --git a/SOURCES/0022-trivial-virt-what.in-doesn-t-use-tabs.patch b/SOURCES/0022-trivial-virt-what.in-doesn-t-use-tabs.patch new file mode 100644 index 0000000..0406ca1 --- /dev/null +++ b/SOURCES/0022-trivial-virt-what.in-doesn-t-use-tabs.patch @@ -0,0 +1,71 @@ +From 4b9101e34d9e5f9c05131161a9702cf1f37e4792 Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Tue, 27 Oct 2015 18:16:02 +0100 +Subject: [PATCH 22/26] trivial: virt-what.in doesn't use tabs + +--- + virt-what.in | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/virt-what.in b/virt-what.in +index d37da85..2c2e6ac 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -54,16 +54,16 @@ usage () { + # Handle the command line arguments, if any. + while test $# -gt 0; do + case "$1" in +- --help) usage ;; ++ --help) usage ;; + --test-root=*) + # Deliberately undocumented: used for 'make check'. + root=$(echo "$1" | sed 's/.*=//') + shift 1 + test -z "$root" && fail "--test-root option requires a value" + ;; +- -v|--version) echo "$VERSION"; exit 0 ;; +- --) shift; break ;; +- *) fail "unrecognized option '$1'";; ++ -v|--version) echo "$VERSION"; exit 0 ;; ++ --) shift; break ;; ++ *) fail "unrecognized option '$1'";; + esac + done + test $# -gt 0 && fail "extra operand '$1'" +@@ -261,7 +261,7 @@ fi + + if ! "$skip_qemu_kvm"; then + if [ "$cpuid" = "KVMKVMKVM" ]; then +- echo kvm ++ echo kvm + elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then + if [ -d "${root}/proc/device-tree" ] && + ls "${root}/proc/device-tree" | grep -q "fw-cfg"; then +@@ -281,8 +281,8 @@ if ! "$skip_qemu_kvm"; then + # string. The long term fix for this would be to export + # another CPUID leaf for non-accelerated qemu. + if grep -q 'QEMU' "${root}/proc/cpuinfo"; then +- echo qemu +- fi ++ echo qemu ++ fi + fi + fi + +@@ -293,11 +293,11 @@ if ! "$skip_lkvm"; then + if [ -d "${root}/proc/device-tree" ] && + grep -q "dummy-virt" "${root}/proc/device-tree/compatible"; then + echo lkvm +- fi ++ fi + fi + fi + + # Check for Docker. + if [ -f "${root}/.dockerinit" ]; then +- echo docker ++ echo docker + fi +-- +1.8.3.1 + diff --git a/SOURCES/0023-qemu-kvm-try-dmidecode-on-all-targets.patch b/SOURCES/0023-qemu-kvm-try-dmidecode-on-all-targets.patch new file mode 100644 index 0000000..e360296 --- /dev/null +++ b/SOURCES/0023-qemu-kvm-try-dmidecode-on-all-targets.patch @@ -0,0 +1,736 @@ +From 8bc06c4843dc0b824e211b6f9f6f358336988b64 Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Tue, 27 Oct 2015 18:16:03 +0100 +Subject: [PATCH 23/26] qemu/kvm: try dmidecode on all targets + +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 | 12 +- + tests/qemu-arm-acpi/proc/cpuinfo | 63 ----------- + tests/qemu-arm-acpi/proc/self/status | 41 ------- + tests/qemu-arm-acpi/sbin/dmidecode | 141 ------------------------ + tests/qemu-arm-acpi/sbin/uname | 2 - + tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper | 2 - + tests/qemu-smbios/proc/cpuinfo | 63 +++++++++++ + tests/qemu-smbios/proc/self/status | 41 +++++++ + tests/qemu-smbios/sbin/dmidecode | 141 ++++++++++++++++++++++++ + tests/qemu-smbios/sbin/uname | 2 + + tests/qemu-smbios/sbin/virt-what-cpuid-helper | 2 + + tests/test-qemu-arm-acpi.sh | 34 ------ + tests/test-qemu-smbios.sh | 34 ++++++ + virt-what.in | 10 +- + 14 files changed, 294 insertions(+), 294 deletions(-) + delete mode 100644 tests/qemu-arm-acpi/proc/cpuinfo + delete mode 100644 tests/qemu-arm-acpi/proc/self/status + delete mode 100755 tests/qemu-arm-acpi/sbin/dmidecode + delete mode 100755 tests/qemu-arm-acpi/sbin/uname + delete mode 100755 tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper + create mode 100644 tests/qemu-smbios/proc/cpuinfo + create mode 100644 tests/qemu-smbios/proc/self/status + create mode 100755 tests/qemu-smbios/sbin/dmidecode + create mode 100755 tests/qemu-smbios/sbin/uname + create mode 100755 tests/qemu-smbios/sbin/virt-what-cpuid-helper + delete mode 100755 tests/test-qemu-arm-acpi.sh + create mode 100755 tests/test-qemu-smbios.sh + +diff --git a/Makefile.am b/Makefile.am +index 2c958ca..0045bcb 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -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 \ +diff --git a/tests/qemu-arm-acpi/proc/cpuinfo b/tests/qemu-arm-acpi/proc/cpuinfo +deleted file mode 100644 +index b83a182..0000000 +--- a/tests/qemu-arm-acpi/proc/cpuinfo ++++ /dev/null +@@ -1,63 +0,0 @@ +-processor : 0 +-Features : fp asimd evtstrm +-CPU implementer : 0x50 +-CPU architecture: 8 +-CPU variant : 0x0 +-CPU part : 0x000 +-CPU revision : 0 +- +-processor : 1 +-Features : fp asimd evtstrm +-CPU implementer : 0x50 +-CPU architecture: 8 +-CPU variant : 0x0 +-CPU part : 0x000 +-CPU revision : 0 +- +-processor : 2 +-Features : fp asimd evtstrm +-CPU implementer : 0x50 +-CPU architecture: 8 +-CPU variant : 0x0 +-CPU part : 0x000 +-CPU revision : 0 +- +-processor : 3 +-Features : fp asimd evtstrm +-CPU implementer : 0x50 +-CPU architecture: 8 +-CPU variant : 0x0 +-CPU part : 0x000 +-CPU revision : 0 +- +-processor : 4 +-Features : fp asimd evtstrm +-CPU implementer : 0x50 +-CPU architecture: 8 +-CPU variant : 0x0 +-CPU part : 0x000 +-CPU revision : 0 +- +-processor : 5 +-Features : fp asimd evtstrm +-CPU implementer : 0x50 +-CPU architecture: 8 +-CPU variant : 0x0 +-CPU part : 0x000 +-CPU revision : 0 +- +-processor : 6 +-Features : fp asimd evtstrm +-CPU implementer : 0x50 +-CPU architecture: 8 +-CPU variant : 0x0 +-CPU part : 0x000 +-CPU revision : 0 +- +-processor : 7 +-Features : fp asimd evtstrm +-CPU implementer : 0x50 +-CPU architecture: 8 +-CPU variant : 0x0 +-CPU part : 0x000 +-CPU revision : 0 +diff --git a/tests/qemu-arm-acpi/proc/self/status b/tests/qemu-arm-acpi/proc/self/status +deleted file mode 100644 +index 751f5e7..0000000 +--- a/tests/qemu-arm-acpi/proc/self/status ++++ /dev/null +@@ -1,41 +0,0 @@ +-Name: cat +-State: R (running) +-Tgid: 8307 +-Ngid: 0 +-Pid: 8307 +-PPid: 1415 +-TracerPid: 0 +-Uid: 0 0 0 0 +-Gid: 0 0 0 0 +-FDSize: 256 +-Groups: +-VmPeak: 109696 kB +-VmSize: 109696 kB +-VmLck: 0 kB +-VmPin: 0 kB +-VmHWM: 832 kB +-VmRSS: 832 kB +-VmData: 320 kB +-VmStk: 256 kB +-VmExe: 64 kB +-VmLib: 1536 kB +-VmPTE: 192 kB +-VmSwap: 0 kB +-Threads: 1 +-SigQ: 0/5821 +-SigPnd: 0000000000000000 +-ShdPnd: 0000000000000000 +-SigBlk: 0000000000000000 +-SigIgn: 0000000000000000 +-SigCgt: 0000000000000000 +-CapInh: 0000000000000000 +-CapPrm: 0000003fffffffff +-CapEff: 0000003fffffffff +-CapBnd: 0000003fffffffff +-Seccomp: 0 +-Cpus_allowed: ff +-Cpus_allowed_list: 0-7 +-Mems_allowed: 1 +-Mems_allowed_list: 0 +-voluntary_ctxt_switches: 1 +-nonvoluntary_ctxt_switches: 1 +diff --git a/tests/qemu-arm-acpi/sbin/dmidecode b/tests/qemu-arm-acpi/sbin/dmidecode +deleted file mode 100755 +index f7ffd4b..0000000 +--- a/tests/qemu-arm-acpi/sbin/dmidecode ++++ /dev/null +@@ -1,141 +0,0 @@ +-#!/bin/sh - +-cat <<'EOF' +-# dmidecode 3.0 +-Getting SMBIOS data from sysfs. +-SMBIOS 3.0.0 present. +-Table at 0x136650000. +- +-Handle 0x0100, DMI type 1, 27 bytes +-System Information +- Manufacturer: QEMU +- Product Name: QEMU Virtual Machine +- Version: 1.0 +- Serial Number: Not Specified +- UUID: 6EB70381-DF9C-4407-B6AB-9FA4452117EA +- Wake-up Type: Power Switch +- SKU Number: Not Specified +- Family: Red Hat Enterprise Linux +- +-Handle 0x0300, DMI type 3, 21 bytes +-Chassis Information +- Manufacturer: QEMU +- Type: Other +- Lock: Not Present +- Version: 1.0 +- Serial Number: Not Specified +- Asset Tag: Not Specified +- Boot-up State: Safe +- Power Supply State: Safe +- Thermal State: Safe +- Security Status: Unknown +- OEM Information: 0x00000000 +- Height: Unspecified +- Number Of Power Cords: Unspecified +- Contained Elements: 0 +- +-Handle 0x0400, DMI type 4, 42 bytes +-Processor Information +- Socket Designation: CPU 0 +- Type: Central Processor +- Family: Other +- Manufacturer: QEMU +- ID: 00 00 00 00 00 00 00 00 +- Version: 1.0 +- Voltage: Unknown +- External Clock: Unknown +- Max Speed: 2000 MHz +- Current Speed: 2000 MHz +- Status: Populated, Enabled +- Upgrade: Other +- L1 Cache Handle: Not Provided +- L2 Cache Handle: Not Provided +- L3 Cache Handle: Not Provided +- Serial Number: Not Specified +- Asset Tag: Not Specified +- Part Number: Not Specified +- Core Count: 1 +- Core Enabled: 1 +- Thread Count: 1 +- Characteristics: None +- +-Handle 0x0401, DMI type 4, 42 bytes +-Processor Information +- Socket Designation: CPU 1 +- Type: Central Processor +- Family: Other +- Manufacturer: QEMU +- ID: 00 00 00 00 00 00 00 00 +- Version: 1.0 +- Voltage: Unknown +- External Clock: Unknown +- Max Speed: 2000 MHz +- Current Speed: 2000 MHz +- Status: Populated, Enabled +- Upgrade: Other +- L1 Cache Handle: Not Provided +- L2 Cache Handle: Not Provided +- L3 Cache Handle: Not Provided +- Serial Number: Not Specified +- Asset Tag: Not Specified +- Part Number: Not Specified +- Core Count: 1 +- Core Enabled: 1 +- Thread Count: 1 +- Characteristics: None +- +-Handle 0x1000, DMI type 16, 23 bytes +-Physical Memory Array +- Location: Other +- Use: System Memory +- Error Correction Type: Multi-bit ECC +- Maximum Capacity: 4 GB +- Error Information Handle: Not Provided +- Number Of Devices: 1 +- +-Handle 0x1100, DMI type 17, 40 bytes +-Memory Device +- Array Handle: 0x1000 +- Error Information Handle: Not Provided +- Total Width: Unknown +- Data Width: Unknown +- Size: 4096 MB +- Form Factor: DIMM +- Set: None +- Locator: DIMM 0 +- Bank Locator: Not Specified +- Type: RAM +- Type Detail: Other +- Speed: Unknown +- Manufacturer: QEMU +- Serial Number: Not Specified +- Asset Tag: Not Specified +- Part Number: Not Specified +- Rank: Unknown +- Configured Clock Speed: Unknown +- Minimum Voltage: Unknown +- Maximum Voltage: Unknown +- Configured Voltage: Unknown +- +-Handle 0x2000, DMI type 32, 11 bytes +-System Boot Information +- Status: No errors detected +- +-Handle 0x0000, DMI type 0, 24 bytes +-BIOS Information +- Vendor: EFI Development Kit II / OVMF +- Version: 0.0.0 +- Release Date: 02/06/2015 +- Address: 0xE8000 +- Runtime Size: 96 kB +- ROM Size: 64 kB +- Characteristics: +- BIOS characteristics not supported +- Targeted content distribution is supported +- UEFI is supported +- System is a virtual machine +- BIOS Revision: 0.0 +- +-Handle 0xFEFF, DMI type 127, 4 bytes +-End Of Table +- +-EOF +diff --git a/tests/qemu-arm-acpi/sbin/uname b/tests/qemu-arm-acpi/sbin/uname +deleted file mode 100755 +index bd33a2d..0000000 +--- a/tests/qemu-arm-acpi/sbin/uname ++++ /dev/null +@@ -1,2 +0,0 @@ +-#!/bin/sh - +-echo aarch64 +diff --git a/tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper b/tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper +deleted file mode 100755 +index 77a6692..0000000 +--- a/tests/qemu-arm-acpi/sbin/virt-what-cpuid-helper ++++ /dev/null +@@ -1,2 +0,0 @@ +-#!/bin/sh - +-# nothing +diff --git a/tests/qemu-smbios/proc/cpuinfo b/tests/qemu-smbios/proc/cpuinfo +new file mode 100644 +index 0000000..b83a182 +--- /dev/null ++++ b/tests/qemu-smbios/proc/cpuinfo +@@ -0,0 +1,63 @@ ++processor : 0 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 1 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 2 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 3 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 4 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 5 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 6 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 7 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 +diff --git a/tests/qemu-smbios/proc/self/status b/tests/qemu-smbios/proc/self/status +new file mode 100644 +index 0000000..751f5e7 +--- /dev/null ++++ b/tests/qemu-smbios/proc/self/status +@@ -0,0 +1,41 @@ ++Name: cat ++State: R (running) ++Tgid: 8307 ++Ngid: 0 ++Pid: 8307 ++PPid: 1415 ++TracerPid: 0 ++Uid: 0 0 0 0 ++Gid: 0 0 0 0 ++FDSize: 256 ++Groups: ++VmPeak: 109696 kB ++VmSize: 109696 kB ++VmLck: 0 kB ++VmPin: 0 kB ++VmHWM: 832 kB ++VmRSS: 832 kB ++VmData: 320 kB ++VmStk: 256 kB ++VmExe: 64 kB ++VmLib: 1536 kB ++VmPTE: 192 kB ++VmSwap: 0 kB ++Threads: 1 ++SigQ: 0/5821 ++SigPnd: 0000000000000000 ++ShdPnd: 0000000000000000 ++SigBlk: 0000000000000000 ++SigIgn: 0000000000000000 ++SigCgt: 0000000000000000 ++CapInh: 0000000000000000 ++CapPrm: 0000003fffffffff ++CapEff: 0000003fffffffff ++CapBnd: 0000003fffffffff ++Seccomp: 0 ++Cpus_allowed: ff ++Cpus_allowed_list: 0-7 ++Mems_allowed: 1 ++Mems_allowed_list: 0 ++voluntary_ctxt_switches: 1 ++nonvoluntary_ctxt_switches: 1 +diff --git a/tests/qemu-smbios/sbin/dmidecode b/tests/qemu-smbios/sbin/dmidecode +new file mode 100755 +index 0000000..f7ffd4b +--- /dev/null ++++ b/tests/qemu-smbios/sbin/dmidecode +@@ -0,0 +1,141 @@ ++#!/bin/sh - ++cat <<'EOF' ++# dmidecode 3.0 ++Getting SMBIOS data from sysfs. ++SMBIOS 3.0.0 present. ++Table at 0x136650000. ++ ++Handle 0x0100, DMI type 1, 27 bytes ++System Information ++ Manufacturer: QEMU ++ Product Name: QEMU Virtual Machine ++ Version: 1.0 ++ Serial Number: Not Specified ++ UUID: 6EB70381-DF9C-4407-B6AB-9FA4452117EA ++ Wake-up Type: Power Switch ++ SKU Number: Not Specified ++ Family: Red Hat Enterprise Linux ++ ++Handle 0x0300, DMI type 3, 21 bytes ++Chassis Information ++ Manufacturer: QEMU ++ Type: Other ++ Lock: Not Present ++ Version: 1.0 ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Boot-up State: Safe ++ Power Supply State: Safe ++ Thermal State: Safe ++ Security Status: Unknown ++ OEM Information: 0x00000000 ++ Height: Unspecified ++ Number Of Power Cords: Unspecified ++ Contained Elements: 0 ++ ++Handle 0x0400, DMI type 4, 42 bytes ++Processor Information ++ Socket Designation: CPU 0 ++ Type: Central Processor ++ Family: Other ++ Manufacturer: QEMU ++ ID: 00 00 00 00 00 00 00 00 ++ Version: 1.0 ++ Voltage: Unknown ++ External Clock: Unknown ++ Max Speed: 2000 MHz ++ Current Speed: 2000 MHz ++ Status: Populated, Enabled ++ Upgrade: Other ++ L1 Cache Handle: Not Provided ++ L2 Cache Handle: Not Provided ++ L3 Cache Handle: Not Provided ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Part Number: Not Specified ++ Core Count: 1 ++ Core Enabled: 1 ++ Thread Count: 1 ++ Characteristics: None ++ ++Handle 0x0401, DMI type 4, 42 bytes ++Processor Information ++ Socket Designation: CPU 1 ++ Type: Central Processor ++ Family: Other ++ Manufacturer: QEMU ++ ID: 00 00 00 00 00 00 00 00 ++ Version: 1.0 ++ Voltage: Unknown ++ External Clock: Unknown ++ Max Speed: 2000 MHz ++ Current Speed: 2000 MHz ++ Status: Populated, Enabled ++ Upgrade: Other ++ L1 Cache Handle: Not Provided ++ L2 Cache Handle: Not Provided ++ L3 Cache Handle: Not Provided ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Part Number: Not Specified ++ Core Count: 1 ++ Core Enabled: 1 ++ Thread Count: 1 ++ Characteristics: None ++ ++Handle 0x1000, DMI type 16, 23 bytes ++Physical Memory Array ++ Location: Other ++ Use: System Memory ++ Error Correction Type: Multi-bit ECC ++ Maximum Capacity: 4 GB ++ Error Information Handle: Not Provided ++ Number Of Devices: 1 ++ ++Handle 0x1100, DMI type 17, 40 bytes ++Memory Device ++ Array Handle: 0x1000 ++ Error Information Handle: Not Provided ++ Total Width: Unknown ++ Data Width: Unknown ++ Size: 4096 MB ++ Form Factor: DIMM ++ Set: None ++ Locator: DIMM 0 ++ Bank Locator: Not Specified ++ Type: RAM ++ Type Detail: Other ++ Speed: Unknown ++ Manufacturer: QEMU ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Part Number: Not Specified ++ Rank: Unknown ++ Configured Clock Speed: Unknown ++ Minimum Voltage: Unknown ++ Maximum Voltage: Unknown ++ Configured Voltage: Unknown ++ ++Handle 0x2000, DMI type 32, 11 bytes ++System Boot Information ++ Status: No errors detected ++ ++Handle 0x0000, DMI type 0, 24 bytes ++BIOS Information ++ Vendor: EFI Development Kit II / OVMF ++ Version: 0.0.0 ++ Release Date: 02/06/2015 ++ Address: 0xE8000 ++ Runtime Size: 96 kB ++ ROM Size: 64 kB ++ Characteristics: ++ BIOS characteristics not supported ++ Targeted content distribution is supported ++ UEFI is supported ++ System is a virtual machine ++ BIOS Revision: 0.0 ++ ++Handle 0xFEFF, DMI type 127, 4 bytes ++End Of Table ++ ++EOF +diff --git a/tests/qemu-smbios/sbin/uname b/tests/qemu-smbios/sbin/uname +new file mode 100755 +index 0000000..bd33a2d +--- /dev/null ++++ b/tests/qemu-smbios/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo aarch64 +diff --git a/tests/qemu-smbios/sbin/virt-what-cpuid-helper b/tests/qemu-smbios/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..77a6692 +--- /dev/null ++++ b/tests/qemu-smbios/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++# nothing +diff --git a/tests/test-qemu-arm-acpi.sh b/tests/test-qemu-arm-acpi.sh +deleted file mode 100755 +index 64db9eb..0000000 +--- a/tests/test-qemu-arm-acpi.sh ++++ /dev/null +@@ -1,34 +0,0 @@ +-# Test for qemu on ARM +-# Copyright (C) 2015 Red Hat Inc. +-# +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or +-# (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# 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 +- +-output="$(./virt-what --test-root=$root 2>&1)" +-expected="qemu" +- +-if [ "$output" != "$expected" ]; then +- echo "$0: test failed because output did not match expected" +- echo "Expected output was:" +- echo "----------------------------------------" +- echo "$expected" +- echo "----------------------------------------" +- echo "But the actual output of the program was:" +- echo "----------------------------------------" +- echo "$output" +- echo "----------------------------------------" +- exit 1 +-fi +diff --git a/tests/test-qemu-smbios.sh b/tests/test-qemu-smbios.sh +new file mode 100755 +index 0000000..114470a +--- /dev/null ++++ b/tests/test-qemu-smbios.sh +@@ -0,0 +1,34 @@ ++# Test for qemu on ARM ++# Copyright (C) 2015 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++root=tests/qemu-smbios ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="qemu" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/virt-what.in b/virt-what.in +index 2c2e6ac..355e438 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -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 +-- +1.8.3.1 + diff --git a/SOURCES/0024-qemu-kvm-dmidecode-look-for-KVM.patch b/SOURCES/0024-qemu-kvm-dmidecode-look-for-KVM.patch new file mode 100644 index 0000000..91a0d08 --- /dev/null +++ b/SOURCES/0024-qemu-kvm-dmidecode-look-for-KVM.patch @@ -0,0 +1,391 @@ +From 8528efafcad59f0fde7e15860f19061c3af810fa Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Tue, 27 Oct 2015 18:16:04 +0100 +Subject: [PATCH 24/26] qemu/kvm: dmidecode: look for 'KVM' + +We can check the product name for 'KVM' to determine if we're +accelerated. This only works for arm/aarch64 targets boot with +AAVMF and on RHEL x86 targets (which already have KVM in the cpuid +leaf), but it doesn't hurt to try on all. +--- + Makefile.am | 6 + + tests/qemu-smbios-kvm/proc/cpuinfo | 63 ++++++++++ + tests/qemu-smbios-kvm/proc/self/status | 41 +++++++ + tests/qemu-smbios-kvm/sbin/dmidecode | 141 ++++++++++++++++++++++ + tests/qemu-smbios-kvm/sbin/uname | 2 + + tests/qemu-smbios-kvm/sbin/virt-what-cpuid-helper | 2 + + tests/test-qemu-smbios-kvm.sh | 34 ++++++ + virt-what.in | 7 +- + 8 files changed, 294 insertions(+), 2 deletions(-) + create mode 100644 tests/qemu-smbios-kvm/proc/cpuinfo + create mode 100644 tests/qemu-smbios-kvm/proc/self/status + create mode 100755 tests/qemu-smbios-kvm/sbin/dmidecode + create mode 100755 tests/qemu-smbios-kvm/sbin/uname + create mode 100755 tests/qemu-smbios-kvm/sbin/virt-what-cpuid-helper + create mode 100755 tests/test-qemu-smbios-kvm.sh + +diff --git a/Makefile.am b/Makefile.am +index 0045bcb..7d87ec1 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -54,6 +54,7 @@ TESTS = \ + tests/test-qemu.sh \ + tests/test-qemu-arm.sh \ + tests/test-qemu-smbios.sh \ ++ tests/test-qemu-smbios-kvm.sh \ + tests/test-rhel5-xen-dom0.sh \ + tests/test-rhel5-xen-domU-hvm.sh \ + tests/test-rhel5-xen-domU-hvm-ia64.sh \ +@@ -143,6 +144,11 @@ EXTRA_DIST = \ + tests/qemu-smbios/sbin/dmidecode \ + tests/qemu-smbios/sbin/uname \ + tests/qemu-smbios/sbin/virt-what-cpuid-helper \ ++ tests/qemu-smbios-kvm/proc/cpuinfo \ ++ tests/qemu-smbios-kvm/proc/self/status \ ++ tests/qemu-smbios-kvm/sbin/dmidecode \ ++ tests/qemu-smbios-kvm/sbin/uname \ ++ tests/qemu-smbios-kvm/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 \ +diff --git a/tests/qemu-smbios-kvm/proc/cpuinfo b/tests/qemu-smbios-kvm/proc/cpuinfo +new file mode 100644 +index 0000000..b83a182 +--- /dev/null ++++ b/tests/qemu-smbios-kvm/proc/cpuinfo +@@ -0,0 +1,63 @@ ++processor : 0 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 1 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 2 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 3 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 4 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 5 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 6 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 ++ ++processor : 7 ++Features : fp asimd evtstrm ++CPU implementer : 0x50 ++CPU architecture: 8 ++CPU variant : 0x0 ++CPU part : 0x000 ++CPU revision : 0 +diff --git a/tests/qemu-smbios-kvm/proc/self/status b/tests/qemu-smbios-kvm/proc/self/status +new file mode 100644 +index 0000000..751f5e7 +--- /dev/null ++++ b/tests/qemu-smbios-kvm/proc/self/status +@@ -0,0 +1,41 @@ ++Name: cat ++State: R (running) ++Tgid: 8307 ++Ngid: 0 ++Pid: 8307 ++PPid: 1415 ++TracerPid: 0 ++Uid: 0 0 0 0 ++Gid: 0 0 0 0 ++FDSize: 256 ++Groups: ++VmPeak: 109696 kB ++VmSize: 109696 kB ++VmLck: 0 kB ++VmPin: 0 kB ++VmHWM: 832 kB ++VmRSS: 832 kB ++VmData: 320 kB ++VmStk: 256 kB ++VmExe: 64 kB ++VmLib: 1536 kB ++VmPTE: 192 kB ++VmSwap: 0 kB ++Threads: 1 ++SigQ: 0/5821 ++SigPnd: 0000000000000000 ++ShdPnd: 0000000000000000 ++SigBlk: 0000000000000000 ++SigIgn: 0000000000000000 ++SigCgt: 0000000000000000 ++CapInh: 0000000000000000 ++CapPrm: 0000003fffffffff ++CapEff: 0000003fffffffff ++CapBnd: 0000003fffffffff ++Seccomp: 0 ++Cpus_allowed: ff ++Cpus_allowed_list: 0-7 ++Mems_allowed: 1 ++Mems_allowed_list: 0 ++voluntary_ctxt_switches: 1 ++nonvoluntary_ctxt_switches: 1 +diff --git a/tests/qemu-smbios-kvm/sbin/dmidecode b/tests/qemu-smbios-kvm/sbin/dmidecode +new file mode 100755 +index 0000000..a2caabb +--- /dev/null ++++ b/tests/qemu-smbios-kvm/sbin/dmidecode +@@ -0,0 +1,141 @@ ++#!/bin/sh - ++cat <<'EOF' ++# dmidecode 3.0 ++Getting SMBIOS data from sysfs. ++SMBIOS 3.0.0 present. ++Table at 0x136650000. ++ ++Handle 0x0100, DMI type 1, 27 bytes ++System Information ++ Manufacturer: QEMU ++ Product Name: KVM Virtual Machine ++ Version: 1.0 ++ Serial Number: Not Specified ++ UUID: 6EB70381-DF9C-4407-B6AB-9FA4452117EA ++ Wake-up Type: Power Switch ++ SKU Number: Not Specified ++ Family: Red Hat Enterprise Linux ++ ++Handle 0x0300, DMI type 3, 21 bytes ++Chassis Information ++ Manufacturer: QEMU ++ Type: Other ++ Lock: Not Present ++ Version: 1.0 ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Boot-up State: Safe ++ Power Supply State: Safe ++ Thermal State: Safe ++ Security Status: Unknown ++ OEM Information: 0x00000000 ++ Height: Unspecified ++ Number Of Power Cords: Unspecified ++ Contained Elements: 0 ++ ++Handle 0x0400, DMI type 4, 42 bytes ++Processor Information ++ Socket Designation: CPU 0 ++ Type: Central Processor ++ Family: Other ++ Manufacturer: QEMU ++ ID: 00 00 00 00 00 00 00 00 ++ Version: 1.0 ++ Voltage: Unknown ++ External Clock: Unknown ++ Max Speed: 2000 MHz ++ Current Speed: 2000 MHz ++ Status: Populated, Enabled ++ Upgrade: Other ++ L1 Cache Handle: Not Provided ++ L2 Cache Handle: Not Provided ++ L3 Cache Handle: Not Provided ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Part Number: Not Specified ++ Core Count: 1 ++ Core Enabled: 1 ++ Thread Count: 1 ++ Characteristics: None ++ ++Handle 0x0401, DMI type 4, 42 bytes ++Processor Information ++ Socket Designation: CPU 1 ++ Type: Central Processor ++ Family: Other ++ Manufacturer: QEMU ++ ID: 00 00 00 00 00 00 00 00 ++ Version: 1.0 ++ Voltage: Unknown ++ External Clock: Unknown ++ Max Speed: 2000 MHz ++ Current Speed: 2000 MHz ++ Status: Populated, Enabled ++ Upgrade: Other ++ L1 Cache Handle: Not Provided ++ L2 Cache Handle: Not Provided ++ L3 Cache Handle: Not Provided ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Part Number: Not Specified ++ Core Count: 1 ++ Core Enabled: 1 ++ Thread Count: 1 ++ Characteristics: None ++ ++Handle 0x1000, DMI type 16, 23 bytes ++Physical Memory Array ++ Location: Other ++ Use: System Memory ++ Error Correction Type: Multi-bit ECC ++ Maximum Capacity: 4 GB ++ Error Information Handle: Not Provided ++ Number Of Devices: 1 ++ ++Handle 0x1100, DMI type 17, 40 bytes ++Memory Device ++ Array Handle: 0x1000 ++ Error Information Handle: Not Provided ++ Total Width: Unknown ++ Data Width: Unknown ++ Size: 4096 MB ++ Form Factor: DIMM ++ Set: None ++ Locator: DIMM 0 ++ Bank Locator: Not Specified ++ Type: RAM ++ Type Detail: Other ++ Speed: Unknown ++ Manufacturer: QEMU ++ Serial Number: Not Specified ++ Asset Tag: Not Specified ++ Part Number: Not Specified ++ Rank: Unknown ++ Configured Clock Speed: Unknown ++ Minimum Voltage: Unknown ++ Maximum Voltage: Unknown ++ Configured Voltage: Unknown ++ ++Handle 0x2000, DMI type 32, 11 bytes ++System Boot Information ++ Status: No errors detected ++ ++Handle 0x0000, DMI type 0, 24 bytes ++BIOS Information ++ Vendor: EFI Development Kit II / OVMF ++ Version: 0.0.0 ++ Release Date: 02/06/2015 ++ Address: 0xE8000 ++ Runtime Size: 96 kB ++ ROM Size: 64 kB ++ Characteristics: ++ BIOS characteristics not supported ++ Targeted content distribution is supported ++ UEFI is supported ++ System is a virtual machine ++ BIOS Revision: 0.0 ++ ++Handle 0xFEFF, DMI type 127, 4 bytes ++End Of Table ++ ++EOF +diff --git a/tests/qemu-smbios-kvm/sbin/uname b/tests/qemu-smbios-kvm/sbin/uname +new file mode 100755 +index 0000000..bd33a2d +--- /dev/null ++++ b/tests/qemu-smbios-kvm/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo aarch64 +diff --git a/tests/qemu-smbios-kvm/sbin/virt-what-cpuid-helper b/tests/qemu-smbios-kvm/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..77a6692 +--- /dev/null ++++ b/tests/qemu-smbios-kvm/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++# nothing +diff --git a/tests/test-qemu-smbios-kvm.sh b/tests/test-qemu-smbios-kvm.sh +new file mode 100755 +index 0000000..f4d8e38 +--- /dev/null ++++ b/tests/test-qemu-smbios-kvm.sh +@@ -0,0 +1,34 @@ ++# Test for qemu on ARM ++# Copyright (C) 2015 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++root=tests/qemu-smbios-kvm ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="kvm" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/virt-what.in b/virt-what.in +index 355e438..776bfde 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -262,9 +262,12 @@ fi + if ! "$skip_qemu_kvm"; then + if [ "$cpuid" = "KVMKVMKVM" ]; then + echo kvm ++ elif echo "$dmi" | grep -q 'Product Name: KVM'; then ++ echo kvm ++ 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. ++ # The test for KVM above failed, so now we know we're ++ # not using KVM acceleration. + echo qemu + skip_lkvm=true + elif [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then +-- +1.8.3.1 + diff --git a/SOURCES/0025-Add-support-for-detecting-ppc64-LPAR-as-virt-guests.patch b/SOURCES/0025-Add-support-for-detecting-ppc64-LPAR-as-virt-guests.patch new file mode 100644 index 0000000..e6148ea --- /dev/null +++ b/SOURCES/0025-Add-support-for-detecting-ppc64-LPAR-as-virt-guests.patch @@ -0,0 +1,1603 @@ +From 0b7c28b283649783d011c059ef0321d349a0ce46 Mon Sep 17 00:00:00 2001 +From: Adrian Likins +Date: Mon, 20 Jun 2016 12:57:27 +0100 +Subject: [PATCH 25/26] Add support for detecting ppc64 LPAR as virt guests. + +https://bugzilla.redhat.com/show_bug.cgi?id=1072524#c13 +--- + Makefile.am | 25 + + tests/ppc64-baremetal/proc/cpuinfo | 805 +++++++++++++++++++++ + tests/ppc64-baremetal/sbin/dmidecode | 3 + + tests/ppc64-baremetal/sbin/uname | 2 + + tests/ppc64-baremetal/sbin/virt-what-cpuid-helper | 2 + + tests/ppc64-kvm/proc/cpuinfo | 84 +++ + tests/ppc64-kvm/proc/self/status | 41 ++ + tests/ppc64-kvm/sbin/dmidecode | 3 + + tests/ppc64-kvm/sbin/uname | 2 + + tests/ppc64-kvm/sbin/virt-what-cpuid-helper | 2 + + tests/ppc64-lpar-dedicated/proc/cpuinfo | 44 ++ + tests/ppc64-lpar-dedicated/proc/ppc64/lparcfg | 46 ++ + tests/ppc64-lpar-dedicated/sbin/dmidecode | 3 + + tests/ppc64-lpar-dedicated/sbin/uname | 2 + + .../sbin/virt-what-cpuid-helper | 2 + + tests/ppc64-lpar-shared/proc/cpuinfo | 45 ++ + tests/ppc64-lpar-shared/proc/ppc64/lparcfg | 51 ++ + tests/ppc64-lpar-shared/proc/self/status | 42 ++ + tests/ppc64-lpar-shared/sbin/dmidecode | 3 + + tests/ppc64-lpar-shared/sbin/uname | 2 + + .../ppc64-lpar-shared/sbin/virt-what-cpuid-helper | 2 + + tests/test-ppc64-baremetal.sh | 34 + + tests/test-ppc64-kvm.sh | 34 + + tests/test-ppc64-lpar-dedicated.sh | 34 + + tests/test-ppc64-lpar-shared.sh | 34 + + virt-what.in | 24 + + 26 files changed, 1371 insertions(+) + create mode 100644 tests/ppc64-baremetal/proc/cpuinfo + create mode 100644 tests/ppc64-baremetal/sbin/dmidecode + create mode 100644 tests/ppc64-baremetal/sbin/uname + create mode 100755 tests/ppc64-baremetal/sbin/virt-what-cpuid-helper + create mode 100644 tests/ppc64-kvm/proc/cpuinfo + create mode 100644 tests/ppc64-kvm/proc/self/status + create mode 100755 tests/ppc64-kvm/sbin/dmidecode + create mode 100755 tests/ppc64-kvm/sbin/uname + create mode 100755 tests/ppc64-kvm/sbin/virt-what-cpuid-helper + create mode 100644 tests/ppc64-lpar-dedicated/proc/cpuinfo + create mode 100644 tests/ppc64-lpar-dedicated/proc/ppc64/lparcfg + create mode 100755 tests/ppc64-lpar-dedicated/sbin/dmidecode + create mode 100755 tests/ppc64-lpar-dedicated/sbin/uname + create mode 100755 tests/ppc64-lpar-dedicated/sbin/virt-what-cpuid-helper + create mode 100644 tests/ppc64-lpar-shared/proc/cpuinfo + create mode 100644 tests/ppc64-lpar-shared/proc/ppc64/lparcfg + create mode 100644 tests/ppc64-lpar-shared/proc/self/status + create mode 100755 tests/ppc64-lpar-shared/sbin/dmidecode + create mode 100755 tests/ppc64-lpar-shared/sbin/uname + create mode 100755 tests/ppc64-lpar-shared/sbin/virt-what-cpuid-helper + create mode 100755 tests/test-ppc64-baremetal.sh + create mode 100755 tests/test-ppc64-kvm.sh + create mode 100755 tests/test-ppc64-lpar-dedicated.sh + create mode 100755 tests/test-ppc64-lpar-shared.sh + +diff --git a/Makefile.am b/Makefile.am +index 7d87ec1..73dfc7b 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -51,6 +51,10 @@ TESTS = \ + tests/test-lxc.sh \ + tests/test-lx86.sh \ + tests/test-parallels-desktop.sh \ ++ tests/test-ppc64-baremetal.sh \ ++ tests/test-ppc64-kvm.sh \ ++ tests/test-ppc64-lpar-dedicated.sh \ ++ tests/test-ppc64-lpar-shared.sh \ + tests/test-qemu.sh \ + tests/test-qemu-arm.sh \ + tests/test-qemu-smbios.sh \ +@@ -128,6 +132,27 @@ EXTRA_DIST = \ + tests/parallels-desktop/sbin/dmidecode \ + tests/parallels-desktop/sbin/uname \ + tests/parallels-desktop/sbin/virt-what-cpuid-helper \ ++ tests/ppc64-baremetal/proc/cpuinfo \ ++ tests/ppc64-baremetal/proc/self/status \ ++ tests/ppc64-baremetal/sbin/dmidecode \ ++ tests/ppc64-baremetal/sbin/uname \ ++ tests/ppc64-baremetal/sbin/virt-what-cpuid-helper \ ++ tests/ppc64-kvm/proc/cpuinfo \ ++ tests/ppc64-kvm/proc/self/status \ ++ tests/ppc64-kvm/sbin/dmidecode \ ++ tests/ppc64-kvm/sbin/uname \ ++ tests/ppc64-kvm/sbin/virt-what-cpuid-helper \ ++ tests/ppc64-lpar-dedicated/proc/cpuinfo \ ++ tests/ppc64-lpar-dedicated/proc/ppc64/lparcfg \ ++ tests/ppc64-lpar-shared/sbin/dmidecode \ ++ tests/ppc64-lpar-shared/sbin/uname \ ++ tests/ppc64-lpar-shared/sbin/virt-what-cpuid-helper \ ++ tests/ppc64-lpar-shared/proc/cpuinfo \ ++ tests/ppc64-lpar-shared/proc/self/status \ ++ tests/ppc64-lpar-shared/proc/ppc64/lparcfg \ ++ tests/ppc64-lpar-shared/sbin/dmidecode \ ++ tests/ppc64-lpar-shared/sbin/uname \ ++ tests/ppc64-lpar-shared/sbin/virt-what-cpuid-helper \ + tests/qemu/proc/cpuinfo \ + tests/qemu/proc/self/status \ + tests/qemu/sbin/dmidecode \ +diff --git a/tests/ppc64-baremetal/proc/cpuinfo b/tests/ppc64-baremetal/proc/cpuinfo +new file mode 100644 +index 0000000..6a4360e +--- /dev/null ++++ b/tests/ppc64-baremetal/proc/cpuinfo +@@ -0,0 +1,805 @@ ++processor : 0 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 1 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 2 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 3 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 4 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 5 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 6 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 7 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 8 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 9 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 10 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 11 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 12 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 13 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 14 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 15 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 16 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 17 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 18 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 19 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 20 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 21 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 22 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 23 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 24 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 25 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 26 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 27 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 28 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 29 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 30 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 31 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 32 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 33 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 34 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 35 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 36 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 37 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 38 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 39 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 40 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 41 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 42 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 43 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 44 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 45 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 46 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 47 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 48 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 49 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 50 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 51 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 52 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 53 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 54 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 55 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 56 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 57 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 58 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 59 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 60 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 61 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 62 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 63 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 64 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 65 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 66 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 67 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 68 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 69 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 70 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 71 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 72 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 73 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 74 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 75 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 76 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 77 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 78 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 79 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 80 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 81 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 82 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 83 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 84 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 85 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 86 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 87 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 88 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 89 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 90 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 91 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 92 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 93 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 94 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 95 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 96 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 97 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 98 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 99 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 100 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 101 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 102 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 103 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 104 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 105 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 106 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 107 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 108 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 109 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 110 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 111 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 112 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 113 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 114 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 115 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 116 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 117 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 118 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 119 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 120 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 121 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 122 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 123 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 124 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 125 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 126 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 127 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 128 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 129 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 130 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 131 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 132 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 133 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 134 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 135 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 136 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 137 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 138 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 139 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 140 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 141 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 142 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 143 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 144 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 145 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 146 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 147 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 148 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 149 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 150 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 151 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 152 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 153 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 154 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 155 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 156 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 157 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 158 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 159 ++cpu : POWER8E (raw), altivec supported ++clock : 3690.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++timebase : 512000000 ++platform : PowerNV ++model : 8247-22L ++machine : PowerNV 8247-22L ++firmware : OPAL v3 +diff --git a/tests/ppc64-baremetal/sbin/dmidecode b/tests/ppc64-baremetal/sbin/dmidecode +new file mode 100644 +index 0000000..f005a9b +--- /dev/null ++++ b/tests/ppc64-baremetal/sbin/dmidecode +@@ -0,0 +1,3 @@ ++#!/bin/sh - ++# dmidecode is not available on Fedora on s/390 ++exit 1 +diff --git a/tests/ppc64-baremetal/sbin/uname b/tests/ppc64-baremetal/sbin/uname +new file mode 100644 +index 0000000..bab06d9 +--- /dev/null ++++ b/tests/ppc64-baremetal/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo ppc64 +diff --git a/tests/ppc64-baremetal/sbin/virt-what-cpuid-helper b/tests/ppc64-baremetal/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..b446009 +--- /dev/null ++++ b/tests/ppc64-baremetal/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo +diff --git a/tests/ppc64-kvm/proc/cpuinfo b/tests/ppc64-kvm/proc/cpuinfo +new file mode 100644 +index 0000000..3871ae6 +--- /dev/null ++++ b/tests/ppc64-kvm/proc/cpuinfo +@@ -0,0 +1,84 @@ ++processor : 0 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 1 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 2 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 3 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 4 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 5 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 6 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 7 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 8 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 9 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 10 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 11 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 12 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 13 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 14 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 15 ++cpu : POWER8E (raw), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++timebase : 512000000 ++platform : pSeries ++model : IBM pSeries (emulated by qemu) ++machine : CHRP IBM pSeries (emulated by qemu) +diff --git a/tests/ppc64-kvm/proc/self/status b/tests/ppc64-kvm/proc/self/status +new file mode 100644 +index 0000000..5408218 +--- /dev/null ++++ b/tests/ppc64-kvm/proc/self/status +@@ -0,0 +1,41 @@ ++Name: cat ++State: R (running) ++Tgid: 24386 ++Ngid: 0 ++Pid: 24386 ++PPid: 21541 ++TracerPid: 0 ++Uid: 0 0 0 0 ++Gid: 0 0 0 0 ++FDSize: 256 ++Groups: 0 ++VmPeak: 110272 kB ++VmSize: 110272 kB ++VmLck: 0 kB ++VmPin: 0 kB ++VmHWM: 1408 kB ++VmRSS: 1408 kB ++VmData: 320 kB ++VmStk: 256 kB ++VmExe: 64 kB ++VmLib: 2112 kB ++VmPTE: 12 kB ++VmSwap: 0 kB ++Threads: 1 ++SigQ: 0/60932 ++SigPnd: 0000000000000000 ++ShdPnd: 0000000000000000 ++SigBlk: 0000000000000000 ++SigIgn: 0000000000000000 ++SigCgt: 0000000000000000 ++CapInh: 0000000000000000 ++CapPrm: 0000001fffffffff ++CapEff: 0000001fffffffff ++CapBnd: 0000001fffffffff ++Seccomp: 0 ++Cpus_allowed: ffff ++Cpus_allowed_list: 0-15 ++Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 ++Mems_allowed_list: 0 ++voluntary_ctxt_switches: 1 ++nonvoluntary_ctxt_switches: 1 +diff --git a/tests/ppc64-kvm/sbin/dmidecode b/tests/ppc64-kvm/sbin/dmidecode +new file mode 100755 +index 0000000..f005a9b +--- /dev/null ++++ b/tests/ppc64-kvm/sbin/dmidecode +@@ -0,0 +1,3 @@ ++#!/bin/sh - ++# dmidecode is not available on Fedora on s/390 ++exit 1 +diff --git a/tests/ppc64-kvm/sbin/uname b/tests/ppc64-kvm/sbin/uname +new file mode 100755 +index 0000000..bab06d9 +--- /dev/null ++++ b/tests/ppc64-kvm/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo ppc64 +diff --git a/tests/ppc64-kvm/sbin/virt-what-cpuid-helper b/tests/ppc64-kvm/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..b446009 +--- /dev/null ++++ b/tests/ppc64-kvm/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo +diff --git a/tests/ppc64-lpar-dedicated/proc/cpuinfo b/tests/ppc64-lpar-dedicated/proc/cpuinfo +new file mode 100644 +index 0000000..2c701cc +--- /dev/null ++++ b/tests/ppc64-lpar-dedicated/proc/cpuinfo +@@ -0,0 +1,44 @@ ++processor : 0 ++cpu : POWER8 (architected), altivec supported ++clock : 4116.000000MHz ++revision : 2.0 (pvr 004b 0200) ++ ++processor : 1 ++cpu : POWER8 (architected), altivec supported ++clock : 4116.000000MHz ++revision : 2.0 (pvr 004b 0200) ++ ++processor : 2 ++cpu : POWER8 (architected), altivec supported ++clock : 4116.000000MHz ++revision : 2.0 (pvr 004b 0200) ++ ++processor : 3 ++cpu : POWER8 (architected), altivec supported ++clock : 4116.000000MHz ++revision : 2.0 (pvr 004b 0200) ++ ++processor : 4 ++cpu : POWER8 (architected), altivec supported ++clock : 4116.000000MHz ++revision : 2.0 (pvr 004b 0200) ++ ++processor : 5 ++cpu : POWER8 (architected), altivec supported ++clock : 4116.000000MHz ++revision : 2.0 (pvr 004b 0200) ++ ++processor : 6 ++cpu : POWER8 (architected), altivec supported ++clock : 4116.000000MHz ++revision : 2.0 (pvr 004b 0200) ++ ++processor : 7 ++cpu : POWER8 (architected), altivec supported ++clock : 4116.000000MHz ++revision : 2.0 (pvr 004b 0200) ++ ++timebase : 512000000 ++platform : pSeries ++model : IBM,8286-42A ++machine : CHRP IBM,8286-42A +diff --git a/tests/ppc64-lpar-dedicated/proc/ppc64/lparcfg b/tests/ppc64-lpar-dedicated/proc/ppc64/lparcfg +new file mode 100644 +index 0000000..bb6915e +--- /dev/null ++++ b/tests/ppc64-lpar-dedicated/proc/ppc64/lparcfg +@@ -0,0 +1,46 @@ ++lparcfg 1.9 ++serial_number=IBM,0210D6B7T ++system_type=IBM,8286-42A ++partition_id=2 ++BoundThrds=1 ++CapInc=100 ++DisWheRotPer=5120000 ++MinEntCap=100 ++MinEntCapPerVP=100 ++MinMem=256 ++MinProcs=1 ++partition_max_entitled_capacity=1600 ++system_potential_processors=16 ++DesEntCap=100 ++DesMem=16384 ++DesProcs=1 ++DesVarCapWt=0 ++DedDonMode=0 ++ ++partition_entitled_capacity=100 ++group=32770 ++system_active_processors=16 ++unallocated_capacity_weight=0 ++capacity_weight=0 ++capped=1 ++unallocated_capacity=0 ++physical_procs_allocated_to_virtualization=0 ++max_proc_capacity_available=0 ++entitled_proc_capacity_available=0 ++entitled_memory=17179869184 ++entitled_memory_group_number=32770 ++entitled_memory_pool_number=65535 ++entitled_memory_weight=0 ++unallocated_entitled_memory_weight=0 ++unallocated_io_mapping_entitlement=0 ++entitled_memory_loan_request=0 ++backing_memory=17179869184 bytes ++cmo_enabled=0 ++dispatches=446065 ++dispatch_dispersions=0 ++purr=2938569265208 ++partition_active_processors=1 ++partition_potential_processors=16 ++shared_processor_mode=0 ++slb_size=32 ++power_mode_data=0002000000020002 +diff --git a/tests/ppc64-lpar-dedicated/sbin/dmidecode b/tests/ppc64-lpar-dedicated/sbin/dmidecode +new file mode 100755 +index 0000000..f005a9b +--- /dev/null ++++ b/tests/ppc64-lpar-dedicated/sbin/dmidecode +@@ -0,0 +1,3 @@ ++#!/bin/sh - ++# dmidecode is not available on Fedora on s/390 ++exit 1 +diff --git a/tests/ppc64-lpar-dedicated/sbin/uname b/tests/ppc64-lpar-dedicated/sbin/uname +new file mode 100755 +index 0000000..bab06d9 +--- /dev/null ++++ b/tests/ppc64-lpar-dedicated/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo ppc64 +diff --git a/tests/ppc64-lpar-dedicated/sbin/virt-what-cpuid-helper b/tests/ppc64-lpar-dedicated/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..b446009 +--- /dev/null ++++ b/tests/ppc64-lpar-dedicated/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo +diff --git a/tests/ppc64-lpar-shared/proc/cpuinfo b/tests/ppc64-lpar-shared/proc/cpuinfo +new file mode 100644 +index 0000000..f1e3f3b +--- /dev/null ++++ b/tests/ppc64-lpar-shared/proc/cpuinfo +@@ -0,0 +1,45 @@ ++processor : 0 ++cpu : POWER8 (architected), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 1 ++cpu : POWER8 (architected), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 2 ++cpu : POWER8 (architected), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 3 ++cpu : POWER8 (architected), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 4 ++cpu : POWER8 (architected), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 5 ++cpu : POWER8 (architected), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 6 ++cpu : POWER8 (architected), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++processor : 7 ++cpu : POWER8 (architected), altivec supported ++clock : 3425.000000MHz ++revision : 2.1 (pvr 004b 0201) ++ ++timebase : 512000000 ++platform : pSeries ++model : IBM,8247-21L ++machine : CHRP IBM,8247-21L ++ +diff --git a/tests/ppc64-lpar-shared/proc/ppc64/lparcfg b/tests/ppc64-lpar-shared/proc/ppc64/lparcfg +new file mode 100644 +index 0000000..fa143a8 +--- /dev/null ++++ b/tests/ppc64-lpar-shared/proc/ppc64/lparcfg +@@ -0,0 +1,51 @@ ++lparcfg 1.9 ++serial_number=IBM,03212D8FA ++system_type=IBM,8247-21L ++partition_id=5 ++BoundThrds=1 ++CapInc=1 ++DisWheRotPer=5120000 ++MinEntCap=10 ++MinEntCapPerVP=5 ++MinMem=256 ++MinProcs=1 ++partition_max_entitled_capacity=1000 ++system_potential_processors=10 ++DesEntCap=10 ++DesMem=8192 ++DesProcs=1 ++DesVarCapWt=128 ++DedDonMode=0 ++ ++partition_entitled_capacity=10 ++group=32773 ++system_active_processors=10 ++pool=0 ++pool_capacity=1000 ++pool_idle_time=99869576477984311 ++pool_num_procs=10 ++unallocated_capacity_weight=0 ++capacity_weight=128 ++capped=0 ++unallocated_capacity=0 ++physical_procs_allocated_to_virtualization=10 ++max_proc_capacity_available=1000 ++entitled_proc_capacity_available=200 ++entitled_memory=8589934592 ++entitled_memory_group_number=32773 ++entitled_memory_pool_number=65535 ++entitled_memory_weight=0 ++unallocated_entitled_memory_weight=0 ++unallocated_io_mapping_entitlement=0 ++entitled_memory_loan_request=0 ++backing_memory=8589934592 bytes ++cmo_enabled=0 ++dispatches=469391613 ++dispatch_dispersions=290411690 ++purr=4110325981916 ++partition_active_processors=1 ++partition_potential_processors=10 ++shared_processor_mode=1 ++slb_size=32 ++power_mode_data=0002000000020002 ++ +diff --git a/tests/ppc64-lpar-shared/proc/self/status b/tests/ppc64-lpar-shared/proc/self/status +new file mode 100644 +index 0000000..528fc82 +--- /dev/null ++++ b/tests/ppc64-lpar-shared/proc/self/status +@@ -0,0 +1,42 @@ ++Name: cat ++State: R (running) ++Tgid: 57629 ++Ngid: 0 ++Pid: 57629 ++PPid: 57206 ++TracerPid: 0 ++Uid: 0 0 0 0 ++Gid: 0 0 0 0 ++FDSize: 256 ++Groups: 0 ++VmPeak: 110272 kB ++VmSize: 110272 kB ++VmLck: 0 kB ++VmPin: 0 kB ++VmHWM: 1152 kB ++VmRSS: 1152 kB ++VmData: 384 kB ++VmStk: 256 kB ++VmExe: 64 kB ++VmLib: 2048 kB ++VmPTE: 14 kB ++VmSwap: 0 kB ++Threads: 1 ++SigQ: 0/30248 ++SigPnd: 0000000000000000 ++ShdPnd: 0000000000000000 ++SigBlk: 0000000000000000 ++SigIgn: 0000000000000000 ++SigCgt: 0000000000000000 ++CapInh: 0000000000000000 ++CapPrm: 0000001fffffffff ++CapEff: 0000001fffffffff ++CapBnd: 0000001fffffffff ++Seccomp: 0 ++Cpus_allowed: ffff,ffffffff,ffffffff ++Cpus_allowed_list: 0-79 ++Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 ++Mems_allowed_list: 0 ++voluntary_ctxt_switches: 1 ++nonvoluntary_ctxt_switches: 1 ++ +diff --git a/tests/ppc64-lpar-shared/sbin/dmidecode b/tests/ppc64-lpar-shared/sbin/dmidecode +new file mode 100755 +index 0000000..f005a9b +--- /dev/null ++++ b/tests/ppc64-lpar-shared/sbin/dmidecode +@@ -0,0 +1,3 @@ ++#!/bin/sh - ++# dmidecode is not available on Fedora on s/390 ++exit 1 +diff --git a/tests/ppc64-lpar-shared/sbin/uname b/tests/ppc64-lpar-shared/sbin/uname +new file mode 100755 +index 0000000..bab06d9 +--- /dev/null ++++ b/tests/ppc64-lpar-shared/sbin/uname +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo ppc64 +diff --git a/tests/ppc64-lpar-shared/sbin/virt-what-cpuid-helper b/tests/ppc64-lpar-shared/sbin/virt-what-cpuid-helper +new file mode 100755 +index 0000000..b446009 +--- /dev/null ++++ b/tests/ppc64-lpar-shared/sbin/virt-what-cpuid-helper +@@ -0,0 +1,2 @@ ++#!/bin/sh - ++echo +diff --git a/tests/test-ppc64-baremetal.sh b/tests/test-ppc64-baremetal.sh +new file mode 100755 +index 0000000..9ca3cee +--- /dev/null ++++ b/tests/test-ppc64-baremetal.sh +@@ -0,0 +1,34 @@ ++# Test for ppc64 lpar baremetal (PowerNV) ++# Copyright (C) 2015 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++root=tests/ppc64-baremetal ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/tests/test-ppc64-kvm.sh b/tests/test-ppc64-kvm.sh +new file mode 100755 +index 0000000..ea844e1 +--- /dev/null ++++ b/tests/test-ppc64-kvm.sh +@@ -0,0 +1,34 @@ ++# Test for kvm on ppc64 ++# Copyright (C) 2015 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++root=tests/ppc64-kvm ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="ibm_ppc64_kvm" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/tests/test-ppc64-lpar-dedicated.sh b/tests/test-ppc64-lpar-dedicated.sh +new file mode 100755 +index 0000000..ef99b27 +--- /dev/null ++++ b/tests/test-ppc64-lpar-dedicated.sh +@@ -0,0 +1,34 @@ ++# Test for ppc64 lpar guests in dedicated mode ++# Copyright (C) 2015 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++root=tests/ppc64-lpar-dedicated ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="ibm_ppc64_lpar_dedicated" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/tests/test-ppc64-lpar-shared.sh b/tests/test-ppc64-lpar-shared.sh +new file mode 100755 +index 0000000..eaac0e4 +--- /dev/null ++++ b/tests/test-ppc64-lpar-shared.sh +@@ -0,0 +1,34 @@ ++# Test for ppc64 lpar guests in shared mode ++# Copyright (C) 2015 Red Hat Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++root=tests/ppc64-lpar-shared ++ ++output="$(./virt-what --test-root=$root 2>&1)" ++expected="ibm_ppc64_lpar_shared" ++ ++if [ "$output" != "$expected" ]; then ++ echo "$0: test failed because output did not match expected" ++ echo "Expected output was:" ++ echo "----------------------------------------" ++ echo "$expected" ++ echo "----------------------------------------" ++ echo "But the actual output of the program was:" ++ echo "----------------------------------------" ++ echo "$output" ++ echo "----------------------------------------" ++ exit 1 ++fi +diff --git a/virt-what.in b/virt-what.in +index 776bfde..a91845e 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -304,3 +304,27 @@ fi + if [ -f "${root}/.dockerinit" ]; then + echo docker + fi ++ ++# Check ppc64 lpar, kvm or powerkvm ++ ++# example /proc/cpuinfo line indicating 'not baremetal' ++# platform : pSeries ++# ++# example /proc/ppc64/lparcfg systemtype line ++# system_type=IBM pSeries (emulated by qemu) ++ ++if [ "$arch" = "ppc64" ]; then ++ if have_cpuinfo && grep -q 'platform.**pSeries' "${root}/proc/cpuinfo"; then ++ if grep -q 'model.*emulated by qemu' "${root}/proc/cpuinfo"; then ++ echo ibm_ppc64_kvm ++ else ++ # Assume LPAR, now detect shared or dedicated ++ if grep -q 'shared_processor_mode=1' "${root}/proc/ppc64/lparcfg"; then ++ echo ibm_ppc64_lpar_shared ++ else ++ echo ibm_ppc64_lpar_dedicated ++ fi ++ # detect powerkvm? ++ fi ++ fi ++fi +-- +1.8.3.1 + diff --git a/SOURCES/0026-Update-the-previous-commit-to-use-system-virt-standa.patch b/SOURCES/0026-Update-the-previous-commit-to-use-system-virt-standa.patch new file mode 100644 index 0000000..118d1c2 --- /dev/null +++ b/SOURCES/0026-Update-the-previous-commit-to-use-system-virt-standa.patch @@ -0,0 +1,104 @@ +From b933eff4e7c86959a096f15e5372d4491e56a55b Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 20 Jun 2016 13:14:53 +0100 +Subject: [PATCH 26/26] Update the previous commit to use - + standard for facts. + +Also I renamed ppc64 to power, since that is the official IBM name. +--- + tests/test-ppc64-kvm.sh | 2 +- + tests/test-ppc64-lpar-dedicated.sh | 2 +- + tests/test-ppc64-lpar-shared.sh | 2 +- + virt-what.in | 6 +++--- + virt-what.pod | 15 +++++++++++++++ + 5 files changed, 21 insertions(+), 6 deletions(-) + +diff --git a/tests/test-ppc64-kvm.sh b/tests/test-ppc64-kvm.sh +index ea844e1..c691c96 100755 +--- a/tests/test-ppc64-kvm.sh ++++ b/tests/test-ppc64-kvm.sh +@@ -18,7 +18,7 @@ + root=tests/ppc64-kvm + + output="$(./virt-what --test-root=$root 2>&1)" +-expected="ibm_ppc64_kvm" ++expected="ibm_power-kvm" + + if [ "$output" != "$expected" ]; then + echo "$0: test failed because output did not match expected" +diff --git a/tests/test-ppc64-lpar-dedicated.sh b/tests/test-ppc64-lpar-dedicated.sh +index ef99b27..0316ea2 100755 +--- a/tests/test-ppc64-lpar-dedicated.sh ++++ b/tests/test-ppc64-lpar-dedicated.sh +@@ -18,7 +18,7 @@ + root=tests/ppc64-lpar-dedicated + + output="$(./virt-what --test-root=$root 2>&1)" +-expected="ibm_ppc64_lpar_dedicated" ++expected="ibm_power-lpar_dedicated" + + if [ "$output" != "$expected" ]; then + echo "$0: test failed because output did not match expected" +diff --git a/tests/test-ppc64-lpar-shared.sh b/tests/test-ppc64-lpar-shared.sh +index eaac0e4..bbc974a 100755 +--- a/tests/test-ppc64-lpar-shared.sh ++++ b/tests/test-ppc64-lpar-shared.sh +@@ -18,7 +18,7 @@ + root=tests/ppc64-lpar-shared + + output="$(./virt-what --test-root=$root 2>&1)" +-expected="ibm_ppc64_lpar_shared" ++expected="ibm_power-lpar_shared" + + if [ "$output" != "$expected" ]; then + echo "$0: test failed because output did not match expected" +diff --git a/virt-what.in b/virt-what.in +index a91845e..0e048a2 100644 +--- a/virt-what.in ++++ b/virt-what.in +@@ -316,13 +316,13 @@ fi + if [ "$arch" = "ppc64" ]; then + if have_cpuinfo && grep -q 'platform.**pSeries' "${root}/proc/cpuinfo"; then + if grep -q 'model.*emulated by qemu' "${root}/proc/cpuinfo"; then +- echo ibm_ppc64_kvm ++ echo ibm_power-kvm + else + # Assume LPAR, now detect shared or dedicated + if grep -q 'shared_processor_mode=1' "${root}/proc/ppc64/lparcfg"; then +- echo ibm_ppc64_lpar_shared ++ echo ibm_power-lpar_shared + else +- echo ibm_ppc64_lpar_dedicated ++ echo ibm_power-lpar_dedicated + fi + # detect powerkvm? + fi +diff --git a/virt-what.pod b/virt-what.pod +index 4e38414..fe9567f 100644 +--- a/virt-what.pod ++++ b/virt-what.pod +@@ -37,6 +37,21 @@ This is Microsoft Hyper-V hypervisor. + + Status: confirmed by RWMJ + ++=item B ++ ++This is an IBM POWER KVM guest. ++ ++Status: contributed by Adrian Likins. ++ ++=item B ++ ++=item B ++ ++This is an IBM POWER LPAR (hardware partition) in either shared ++or dedicated mode. ++ ++Status: contributed by Adrian Likins. ++ + =item B + + This is an IBM SystemZ (or other S/390) hardware partitioning system. +-- +1.8.3.1 + diff --git a/SPECS/virt-what.spec b/SPECS/virt-what.spec index 172f1ba..2c03384 100644 --- a/SPECS/virt-what.spec +++ b/SPECS/virt-what.spec @@ -1,30 +1,40 @@ Name: virt-what Version: 1.13 -Release: 6%{?dist} +Release: 8%{?dist} Summary: Detect if we are running in a virtual machine License: GPLv2+ URL: http://people.redhat.com/~rjones/virt-what/ Source0: http://people.redhat.com/~rjones/virt-what/files/%{name}-%{version}.tar.gz -Patch1: 0001-Differentiate-between-vserver-host-and-guest.patch -Patch2: 0002-Detect-new-Xen-VMs-RHBZ-973663.patch -Patch3: 0001-xen-Don-t-emit-warning-message-if-proc-xen-capabilit.patch -Patch4: 0001-Fix-various-typos-and-mistakes-in-comments.patch -Patch5: 0003-Fix-spelling-mistake-in-the-man-page-RHBZ-1099289.patch -Patch6: 0004-Added-check-and-test-routines-for-Docker.patch -Patch7: 0005-Added-documentation-for-Docker-tests.patch -Patch8: 0006-virt-what.in-remove-bash-ism.patch -Patch9: 0007-virt-what.in-get-effective-uid-in-a-portable-way.patch -Patch10: 0008-virt-what.in-warn-about-missing-cpuid-virt-helper-pr.patch -Patch11: 0009-virt-what.in-verify-files-exists-before-grepping-the.patch -Patch12: 0010-virt-what.in-make-option-processing-portable.patch -Patch13: 0011-build-use-portable-Makefile-variables.patch -Patch14: 0012-Add-space-before-parens-in-function-defns-for-readab.patch -Patch15: 0013-Add-lkvm-detection.patch -Patch16: 0014-Add-ARM-support.patch -Patch17: 0015-xen-arm-Fix-path-in-EXTRA_DIST.patch - +# These patches are kept in the upstream git repo, in the rhel-7.3 branch. +# http://git.annexia.org/?p=virt-what.git;a=shortlog;h=refs/heads/rhel-7.3 +Patch0001: 0001-Differentiate-between-vserver-host-and-guest.patch +Patch0002: 0002-Detect-new-Xen-VMs-RHBZ-973663.patch +Patch0003: 0003-xen-Don-t-emit-warning-message-if-proc-xen-capabilit.patch +Patch0004: 0004-Fix-various-typos-and-mistakes-in-comments.patch +Patch0005: 0005-Fix-spelling-mistake-in-the-man-page-RHBZ-1099289.patch +Patch0006: 0006-Added-check-and-test-routines-for-Docker.patch +Patch0007: 0007-Added-documentation-for-Docker-tests.patch +Patch0008: 0008-virt-what.in-remove-bash-ism.patch +Patch0009: 0009-virt-what.in-get-effective-uid-in-a-portable-way.patch +Patch0010: 0010-virt-what.in-warn-about-missing-cpuid-virt-helper-pr.patch +Patch0011: 0011-virt-what.in-verify-files-exists-before-grepping-the.patch +Patch0012: 0012-virt-what.in-make-option-processing-portable.patch +Patch0013: 0013-build-use-portable-Makefile-variables.patch +Patch0014: 0014-Add-space-before-parens-in-function-defns-for-readab.patch +Patch0015: 0015-Add-lkvm-detection.patch +Patch0016: 0016-Add-ARM-support.patch +Patch0017: 0017-xen-arm-Fix-path-in-EXTRA_DIST.patch +Patch0018: 0018-Update-copyright-years.patch +Patch0019: 0019-Add-QEMU-KVM-detection-for-ACPI-boot-ARM.patch +Patch0020: 0020-trivial-comment-fixup.patch +Patch0021: 0021-Add-oVirt-RHBZ-1249438.patch +Patch0022: 0022-trivial-virt-what.in-doesn-t-use-tabs.patch +Patch0023: 0023-qemu-kvm-try-dmidecode-on-all-targets.patch +Patch0024: 0024-qemu-kvm-dmidecode-look-for-KVM.patch +Patch0025: 0025-Add-support-for-detecting-ppc64-LPAR-as-virt-guests.patch +Patch0026: 0026-Update-the-previous-commit-to-use-system-virt-standa.patch # This is provided by the build root, but we make it explicit # anyway in case this was dropped from the build root in future. @@ -41,7 +51,7 @@ BuildRequires: automake # virt-what script uses dmidecode and getopt (from util-linux). # RPM cannot detect this so make the dependencies explicit here. -%ifarch %{ix86} x86_64 +%ifarch aarch64 %{ix86} x86_64 Requires: dmidecode %endif Requires: util-linux @@ -111,6 +121,20 @@ make check %changelog +* Wed Jul 27 2016 Richard W.M. Jones - 1.13-8 +- Depend on dmidecode on aarch64 + resolves: rhbz#1360699 + +* Mon Jun 20 2016 Richard W.M. Jones - 1.13-7 +- Add support for detecting POWER KVM and LPAR + resolves: rhbz#1147876 +- Detect RHEV/oVirt + resolves: rhbz#1249438 +- Detect ACPI boot aarch64 guest + resolves: rhbz#1275349 +- Fix typo in manual page + resolves: rhbz#1099289 + * Tue Apr 21 2015 Richard W.M. Jones - 1.13-6 - Fix detection of aarch64 resolves: rhbz#1201845