tests/rhel5-xen-domU-pv/sbin/dmidecode \
tests/rhel5-xen-domU-pv/sbin/id \
tests/rhel5-xen-domU-pv/sbin/virt-what-cpuid-helper \
+ tests/zvm/proc/cpuinfo \
+ tests/zvm/proc/self/status \
+ tests/zvm/sbin/dmidecode \
+ tests/zvm/sbin/id \
+ tests/zvm/sbin/virt-what-cpuid-helper \
tests/test-baremetal.sh \
tests/test-esx4.1.sh \
tests/test-kvm.sh \
tests/test-qemu.sh \
tests/test-rhel5-xen-dom0.sh \
tests/test-rhel5-xen-domU-hvm.sh \
- tests/test-rhel5-xen-domU-pv.sh
+ tests/test-rhel5-xen-domU-pv.sh \
+ tests/test-zvm.sh
CLEANFILES = virt-what.1 virt-what.txt
tests/test-qemu.sh \
tests/test-rhel5-xen-dom0.sh \
tests/test-rhel5-xen-domU-hvm.sh \
- tests/test-rhel5-xen-domU-pv.sh
+ tests/test-rhel5-xen-domU-pv.sh \
+ tests/test-zvm.sh
--- /dev/null
+# Test for z/VM on IBM SystemZ mainframe.
+# (Thanks Dan Horák for supplying access).
+# 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/zvm
+
+output="$(./virt-what --test-root=$root 2>&1)"
+expected="zvm"
+
+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
--- /dev/null
+vendor_id : IBM/S390
+# processors : 1
+bogomips per cpu: 11061.00
+features : esan3 zarch stfle msa ldisp eimm dfp etf3eh highgprs
+processor 0: version = FF, identification = 15C5C2, machine = 2097
--- /dev/null
+Name: cat
+State: R (running)
+Tgid: 8722
+Pid: 8722
+PPid: 569
+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: 99096 kB
+VmSize: 99096 kB
+VmLck: 0 kB
+VmHWM: 564 kB
+VmRSS: 564 kB
+VmData: 176 kB
+VmStk: 136 kB
+VmExe: 48 kB
+VmLib: 98720 kB
+VmPTE: 14 kB
+VmSwap: 0 kB
+Threads: 1
+SigQ: 0/7958
+SigPnd: 0000000000000000
+ShdPnd: 0000000000000000
+SigBlk: 0000000000000000
+SigIgn: 0000000000000000
+SigCgt: 0000000000000000
+CapInh: 0000000000000000
+CapPrm: ffffffffffffffff
+CapEff: ffffffffffffffff
+CapBnd: ffffffffffffffff
+Cpus_allowed: ffffffff,ffffffff
+Cpus_allowed_list: 0-63
+Mems_allowed: 1
+Mems_allowed_list: 0
+task: 000000007c0fae50, ksp: 000000007c3d3eb8
+User PSW : 0705c00180000000 00000200001336b8
+User GPRS: 000003ff00000000 00000200001f3748 0000000000000003 000000008000f000
+ 0000000000008000 000000008000e020 0000000000000000 000003ffffaa75e0
+ 0000000000008000 0000000000000001 000000008000f000 0000000000000003
+ 000000008000c348 0000000000008000 0000000080006746 000003ffffaa70b8
+User ACRS: 00000200 00223f10 00000000 00000000
+ 00000000 00000000 00000000 00000000
+ 00000000 00000000 00000000 00000000
+ 00000000 00000000 00000000 00000000
+voluntary_ctxt_switches: 0
+nonvoluntary_ctxt_switches: 0
--- /dev/null
+#!/bin/sh -
+# dmidecode is not available on Fedora on s/390
+exit 1
--- /dev/null
+#!/bin/sh -
+echo 0
--- /dev/null
+#!/bin/sh -
+echo
echo virtage
fi
+# Check for IBM SystemZ (z/VM, not tested whether this applies to Linux
+# installed directly into an LPAR, we may need a separate test).
+if grep -q '^vendor_id.*IBM/S390' $root/proc/cpuinfo; then
+ echo zvm
+fi
+
# Check for Xen.
if [ "$cpuid" = "XenVMMXenVMM" ]; then
Status: confirmed by RWMJ
+=item B<zvm>
+
+This is a z/VM guest running on an IBM SystemZ mainframe.
+
+Status: confirmed by RWMJ using a Fedora guest running in z/VM. Not
+tested whether this also works for Linux installed directly in an
+LPAR.
+
=back
=head1 IMPORTANT NOTE