virt-what.git
16 months agovirt-what-cvm: check if hypervisor bit is set
Daniel P. Berrangé [Thu, 29 Jun 2023 16:51:02 +0000 (17:51 +0100)]
virt-what-cvm: check if hypervisor bit is set

Before doing any probes for a confidential VM, check that the
tool is running under a hypervisor, rather than bare metal

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
16 months agoAdd support for CRI-O containers
Richard W.M. Jones [Wed, 28 Jun 2023 09:00:42 +0000 (10:00 +0100)]
Add support for CRI-O containers

Reported-by: Alessandro Taufer
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2217407
Thanks: Xiaodai Wang

17 months agonutanix: Don't match Nutanix-based baremetal systems
Richard W.M. Jones [Wed, 7 Jun 2023 09:10:03 +0000 (10:10 +0100)]
nutanix: Don't match Nutanix-based baremetal systems

Nutanix ship baremetal systems which have modified firmware that
reports similar to:

  Manufacturer: Nutanix
  Product Name: NX-T00-4NL3-G5

This is not a virtual machine, but was recognised as such.  Make sure
we match on 'Product Name: AHV' to identify only virtual machines.

Thanks: Scott Yeager, Shaoyu Shang
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2211980

17 months agodocs: Add cross reference to virt-what-cvm(1) to virt-what(1)
Richard W.M. Jones [Tue, 30 May 2023 07:46:06 +0000 (08:46 +0100)]
docs: Add cross reference to virt-what-cvm(1) to virt-what(1)

17 months agoIntroduce 'virt-what-cvm' program
Daniel P. Berrangé [Fri, 26 May 2023 11:39:03 +0000 (12:39 +0100)]
Introduce 'virt-what-cvm' program

The 'virt-what' program prints facts that reflect the hypervisor that
the guest is running under.

The new complementary 'virt-what-cvm' program prints facts that reflect
the confidential virtualization technology the guest is running under,
if any.

It is kept as a separate tool, rather than incorporating the facts into
'virt-what' output because it is considering a different aspect of the
virtualization. Furthermore there are specific security concerns around
the usage of facts reported by 'virt-what-cvm'.

The tool has been tested in a number of environments

 * Azure confidential guest with AMD SEV-SNP (GA)
 * Azure confidential guest with Intel TDX (technology preview)
 * Fedora 37 QEMU/KVM guest with AMD SEV (GA)
 * Fedora 37 QEMU/KVM guest with AMD SEV-ES (GA)
 * Fedora 38 QEMU/KVM guest with AMD SEV-SNP + SVSM (devel snapshot)

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agoAdd support for Alibaba cloud on aarch64
Yongkui Guo [Mon, 30 Jan 2023 10:20:32 +0000 (18:20 +0800)]
Add support for Alibaba cloud on aarch64

This assumes you are running RHEL or another tenant which supports
ACPI.  It probably won't work for guests using device tree.

Also we assume that the hypervisor is KVM.  Since the hypervisor
indicates that it is RHEL 7, this is very likely to be true, but hard
to prove since there is no CPUID on Arm.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2165285

22 months agoAdd support for UpCloud
Ville Skyttä [Thu, 12 Jan 2023 09:48:17 +0000 (11:48 +0200)]
Add support for UpCloud

22 months agoGrammar fixes
Ville Skyttä [Wed, 28 Dec 2022 21:03:34 +0000 (23:03 +0200)]
Grammar fixes

22 months agoDetect OCI containers
Richard W.M. Jones [Thu, 5 Jan 2023 12:34:02 +0000 (12:34 +0000)]
Detect OCI containers

Podman using OCI containers sets container=oci in PID 1's environment.
Detect that and print "oci" fact.

This patch was originally contributed by Alessandro Valentini.  I
modified it and added tests and documentation.

Reported-by: Alessandro Valentini
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2155233

22 months agopodman: Fix location of test file /proc/1/environ
Richard W.M. Jones [Thu, 5 Jan 2023 12:48:55 +0000 (12:48 +0000)]
podman: Fix location of test file /proc/1/environ

Since it was at the wrong location, the file was not even used by the
test.

Fixes: commit 1df728aa4b ("Add podman support")

23 months agoMove docker and podman tests up, add comments
Richard W.M. Jones [Thu, 22 Dec 2022 10:34:03 +0000 (10:34 +0000)]
Move docker and podman tests up, add comments

Refactor to bring related tests closer together and make the comments
more uniform.

23 months agoRearrange lxc test to avoid use of cat
Richard W.M. Jones [Thu, 22 Dec 2022 10:31:47 +0000 (10:31 +0000)]
Rearrange lxc test to avoid use of cat

Thanks: Elias Probst <e.probst@ssc-services.de>

2 years agoVersion 1.25. rhel-8.7 rhel-9.1 v1.25
Richard W.M. Jones [Wed, 17 Aug 2022 09:57:19 +0000 (10:57 +0100)]
Version 1.25.

2 years agodetect AWS arm virtual instance as kvm
Xiao Liang [Tue, 24 May 2022 09:34:52 +0000 (17:34 +0800)]
detect AWS arm virtual instance as kvm

AWS arm virtual instance is KVM based hypervisor.
With this patch:
$ sudo virt-what
kvm
aws
$ cat /sys/devices/virtual/dmi/id/product_name
t4g.small

Without it:
$ sudo virt-what
aws

Signed-off-by: Xiao Liang <xiliang@redhat.com>
2 years agogoogle-cloud: Print "kvm" fact on aarch64 instances
Richard W.M. Jones [Mon, 8 Aug 2022 16:13:11 +0000 (12:13 -0400)]
google-cloud: Print "kvm" fact on aarch64 instances

GCE instances are KVM with a non-QEMU userspace.  On x86-64 we should
recognize this from the CPUID information, but aarch64 has no
equivalent to this.  /proc/device-tree/hypervisor/compatible contains
something but RHEL does not use device tree.  However the SMBIOS
tables exported by GCE do contain:

  Manufacturer: KVM

so we can use that.

  # uname -m
  aarch64
  # virt-what
  google_cloud
  kvm

This commit also updates the test.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2114997
Updates: commit 54b726fa7c9687b692162488e8934a426f9fa6c3
Thanks: Eric Auger, Yongkui Guo

2 years agotests: Add test for Google Cloud Engine
Richard W.M. Jones [Wed, 3 Aug 2022 17:53:19 +0000 (17:53 +0000)]
tests: Add test for Google Cloud Engine

This was actually a GCE aarch64 instance, but I believe the
architecture makes no difference as all we're looking for is the
characteristic string in dmidecode output.

Thanks: Craig Donnelly
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2114997
Updates: commit 8363fa9f0e2cbd970f34ffb7c7b23ed0ac2c374a

2 years agoalibaba-cloud: Make the test more robust
Richard W.M. Jones [Wed, 3 Aug 2022 17:37:23 +0000 (17:37 +0000)]
alibaba-cloud: Make the test more robust

This test worked by trying to make an HTTP connection to a path under
100.100.100.200, which if successful would indicate that it's an
Alibaba cloud instance.  We only try the connection if SM-BIOS
information indicates the hardware OEM is Alibaba.

However 'make check' would hang if 100.100.100.200 doesn't immediately
reject the connection.  I found that GCE is such an environment where
connecting to this address would hang rather than reject.  GCE does
not have Alibaba hardware of course, but when doing 'make check' we
fake dmidecode data.

Make the test more robust by only trying to connect when we know we're
not in 'make check'.

Fixes: commit b7cc3d93a613ef6d0ac5ccd6e32cc3d66e057243

2 years agoVersion 1.24. v1.24
Richard W.M. Jones [Thu, 23 Jun 2022 13:42:02 +0000 (14:42 +0100)]
Version 1.24.

2 years agoillumos-lx: Fix test so it works under virtualization
Richard W.M. Jones [Thu, 23 Jun 2022 13:38:55 +0000 (14:38 +0100)]
illumos-lx: Fix test so it works under virtualization

Tests need to provide dummy sbin/virt-what-cpuid-helper, dmidecode and
uname.  This ensures that if we are running the test suite under (eg)
KVM, that virt-what doesn't discover this.

The failure was:

./test.sh: test failed because output did not match expected
Expected output was:
----------------------------------------
illumos-lx
----------------------------------------
But the actual output of the program was:
----------------------------------------
illumos-lx
kvm
----------------------------------------

Fixes: commit 763cf1b1123136751b71f475610c5ac1eeaba0ad

2 years agoVersion 1.23. v1.23
Richard W.M. Jones [Thu, 23 Jun 2022 12:43:20 +0000 (13:43 +0100)]
Version 1.23.

2 years agoDetect Illumos (SmartOS/OmniOS) LX virtualization
Steve Mokris [Thu, 12 May 2022 16:02:46 +0000 (12:02 -0400)]
Detect Illumos (SmartOS/OmniOS) LX virtualization

Thanks for the feedback, Eric and Richard.  In this version, I've expunged the redundant cats and included the Makefile.am.

2 years agoVersion 1.22. v1.22
Richard W.M. Jones [Thu, 14 Apr 2022 12:51:49 +0000 (13:51 +0100)]
Version 1.22.

2 years agoAdd test file to EXTRA_DIST
Richard W.M. Jones [Thu, 14 Apr 2022 12:51:13 +0000 (13:51 +0100)]
Add test file to EXTRA_DIST

Fixes: commit 1df728aa4b1d2814265f9c86494f7d55ee0cf9af

2 years agoAdd test file to EXTRA_DIST
Richard W.M. Jones [Thu, 14 Apr 2022 12:50:46 +0000 (13:50 +0100)]
Add test file to EXTRA_DIST

Fixes: commit 7e679278431aa1a188dfe423526dfea82fddcbd3

3 years agoDisplay kvm/qemu fact for Nutanix AHV
Richard W.M. Jones [Thu, 22 Jul 2021 07:58:16 +0000 (08:58 +0100)]
Display kvm/qemu fact for Nutanix AHV

Since these are based on KVM we should display those facts too.

Thanks: Paolo Bonzini

3 years agoAdd detection of Red Hat's hypervisor
Richard W.M. Jones [Mon, 19 Jul 2021 17:05:14 +0000 (18:05 +0100)]
Add detection of Red Hat's hypervisor

Red Hat sets the following fields in SMBIOS information, allowing us
to detect that it's the branded Red Hat hypervisor.

  Manufacturer: Red Hat
  Product Name: KVM
  Version: RHEL 7.6.0 PC (i440FX + PIIX, 1996)

Note that "RHEL 7.6.0" there is the machine type, which is not the
same as the hypervisor version (although the two have a relationship).

Thanks: Timothy Smith at IBM, Karen Noel

3 years agoAdd Google Cloud (not tested)
Richard W.M. Jones [Mon, 19 Jul 2021 14:14:32 +0000 (15:14 +0100)]
Add Google Cloud (not tested)

Thanks: Paolo Bonzini

3 years agouse official product name for alibaba cloud bare-metal instances
Weisson [Fri, 2 Jul 2021 09:06:07 +0000 (17:06 +0800)]
use official product name for alibaba cloud bare-metal instances

3 years agoCheck for Alibaba Cloud X-Dragon Architecture
Weisson [Tue, 1 Jun 2021 12:49:17 +0000 (20:49 +0800)]
Check for Alibaba Cloud X-Dragon Architecture

Thanks to Richard W.M. Jones' Super Powerful Bash Script

3 years agoAdd test for Alibaba Cloud Linux
Weisson [Thu, 27 May 2021 09:55:57 +0000 (10:55 +0100)]
Add test for Alibaba Cloud Linux

3 years agoAdd support for Alibaba Cloud Linux
Weisson [Thu, 27 May 2021 09:53:08 +0000 (10:53 +0100)]
Add support for Alibaba Cloud Linux

3 years agoaws: Match multi-digit version number in BIOS information
Richard W.M. Jones [Wed, 26 May 2021 10:31:24 +0000 (11:31 +0100)]
aws: Match multi-digit version number in BIOS information

See: https://listman.redhat.com/archives/virt-tools-list/2021-May/msg00011.html
Reported-by: Stuart Cooper
3 years agoAdd support for VMware ESXi on ARM
Razvan Corneliu [Mon, 10 May 2021 20:02:27 +0000 (21:02 +0100)]
Add support for VMware ESXi on ARM

Virt-what doesn't recognize VMware VMs for AARCH64/ARM (with licensing
implications in ESXi Fling for ARM and Fusion v.Next for ARM). I've
created and attached a patch that adds both support for recognizing
ESXi and the automated tests for it.

3 years agoVersion 1.21. v1.21
Richard W.M. Jones [Mon, 19 Apr 2021 11:56:58 +0000 (12:56 +0100)]
Version 1.21.

3 years agoSimplify and fix invocation of cpuid.
Richard W.M. Jones [Tue, 13 Apr 2021 08:35:07 +0000 (09:35 +0100)]
Simplify and fix invocation of cpuid.

Fixes a crash on some platforms identified by Yongkui Guo in
https://bugzilla.redhat.com/show_bug.cgi?id=1756381#c15

4 years agoAdd podman support
Jordan Webb [Mon, 13 Apr 2020 21:41:30 +0000 (21:41 +0000)]
Add podman support

4 years agodocker: Lookup from /proc/self/cgroup too
Ville Skyttä [Sun, 1 Dec 2019 06:21:32 +0000 (08:21 +0200)]
docker: Lookup from /proc/self/cgroup too

Refs https://github.com/moby/moby/issues/18355

4 years agodocker: Check for /.dockerenv too
Ville Skyttä [Sun, 1 Dec 2019 05:58:04 +0000 (07:58 +0200)]
docker: Check for /.dockerenv too

/.dockerinit may no longer exist.

Ref https://github.com/moby/moby/issues/18355

5 years agoFix incorrect detection of MS Surfacebook 2 as a virtual machine.
willem van de velde [Tue, 22 Oct 2019 10:58:01 +0000 (11:58 +0100)]
Fix incorrect detection of MS Surfacebook 2 as a virtual machine.

5 years agohelper: Fix KVM signature.
Richard W.M. Jones [Fri, 4 Oct 2019 17:30:01 +0000 (18:30 +0100)]
helper: Fix KVM signature.

Thanks: Paolo Bonzini.

5 years agoAdd support for Nutanix Acropolis Hypervisor (AHV) (RHBZ#1756381).
Richard W.M. Jones [Fri, 4 Oct 2019 13:25:55 +0000 (16:25 +0300)]
Add support for Nutanix Acropolis Hypervisor (AHV) (RHBZ#1756381).

Thanks: Cristian Seres for providing access to a guest.

5 years agoFix virt-what-cpuid-helper.
Richard W.M. Jones [Fri, 4 Oct 2019 12:57:42 +0000 (15:57 +0300)]
Fix virt-what-cpuid-helper.

The value returned in %eax is the max_entry (eg. 0x40000000
if there are no further leafs).  However it is not reliable.
In addition if there are multiple leafs we should probably
only print the highest one.

Also use uint32_t instead of unsigned int.

Thanks: Paolo Bonzini.

5 years agoVersion 1.20. v1.20
Richard W.M. Jones [Thu, 3 Oct 2019 09:21:12 +0000 (10:21 +0100)]
Version 1.20.

5 years agomaintainer: Add rules for maintainers.
Richard W.M. Jones [Thu, 3 Oct 2019 09:13:43 +0000 (10:13 +0100)]
maintainer: Add rules for maintainers.

Adds:
make maintainer-check-extra-dist
make maintainer-commit
make maintainer-tag

5 years agobuild: Add .gitignore to tarball.
Richard W.M. Jones [Thu, 3 Oct 2019 09:16:08 +0000 (10:16 +0100)]
build: Add .gitignore to tarball.

Mainly to keep maintainer-check-extra-dist happy.

5 years agoArrange tests in subdirectories.
Richard W.M. Jones [Thu, 3 Oct 2019 08:53:49 +0000 (09:53 +0100)]
Arrange tests in subdirectories.

This simplifies and isolates each test.

5 years agobuild: Remove *~ files on make clean.
Richard W.M. Jones [Thu, 3 Oct 2019 08:08:19 +0000 (09:08 +0100)]
build: Remove *~ files on make clean.

5 years agoaws: Add regression test for AWS on KVM on ARM architecture.
Richard W.M. Jones [Wed, 31 Oct 2018 15:23:45 +0000 (15:23 +0000)]
aws: Add regression test for AWS on KVM on ARM architecture.

6 years agoVersion 1.19. v1.19
Richard W.M. Jones [Wed, 31 Oct 2018 19:04:22 +0000 (19:04 +0000)]
Version 1.19.

6 years agoaws: Add regression test for AWS on Xen on x86_64 architecture.
Richard W.M. Jones [Wed, 31 Oct 2018 15:23:45 +0000 (15:23 +0000)]
aws: Add regression test for AWS on Xen on x86_64 architecture.

6 years agoaws: Add regression test for AWS on baremetal on x86_64 architecture.
Richard W.M. Jones [Wed, 31 Oct 2018 15:43:20 +0000 (15:43 +0000)]
aws: Add regression test for AWS on baremetal on x86_64 architecture.

6 years agoaws: Add regression test for AWS on KVM on x86_64 architecture.
Richard W.M. Jones [Wed, 31 Oct 2018 15:23:45 +0000 (15:23 +0000)]
aws: Add regression test for AWS on KVM on x86_64 architecture.

6 years agotests: Fix tests when run on AWS.
Richard W.M. Jones [Wed, 31 Oct 2018 15:35:34 +0000 (15:35 +0000)]
tests: Fix tests when run on AWS.

When running on AWS two of the tests failed.  This was because the
tests did _not_ include a working dmidecode binary, hence the platform
dmidecode binary was being run instead, and that was detecting as AWS
owing to the previous commit.  Fix this by supplying a working
dmidecode binary for those tests.

6 years agoaws: Detect AWS from dmidecode information.
Richard W.M. Jones [Wed, 31 Oct 2018 15:04:24 +0000 (15:04 +0000)]
aws: Detect AWS from dmidecode information.

Move the AWS detection out from under Xen.  AWS runs on KVM and
baremetal these days.  The dmidecode information for KVM and baremetal
is a little bit different so we also need to adjust the test for that
case.

Typical SMBIOS info for Xen:

BIOS Information
        Vendor: Xen
        Version: 4.2.amazon

Typical SMBIOS info for KVM and baremetal:

BIOS Information
        Vendor: Amazon EC2
        Version: 1.0

Thanks: Vitaly Kuznetsov, Jon Masters.

6 years agoReplace == with = since the former is a bash-ism.
Richard W.M. Jones [Tue, 28 Aug 2018 17:32:41 +0000 (18:32 +0100)]
Replace == with = since the former is a bash-ism.

Thanks: Eric Blake.

Fixes commit d7fd8a7843030d2b1719353edfcd49dba3000122.

6 years agoAllow using sysctl, for example when /proc isn't available
Jasper Lievisse Adriaanse [Wed, 25 Apr 2018 14:41:32 +0000 (16:41 +0200)]
Allow using sysctl, for example when /proc isn't available

6 years agoDetermine architecture via 'uname -m'
Guido Günther [Sat, 27 Jan 2018 12:11:36 +0000 (13:11 +0100)]
Determine architecture via 'uname -m'

'uname -p' only gives unknown on x86_64, i386, arm6l (rpi) and aarch64
(scaleways).

7 years agoRecognize ppc64le (little endian) virtualization (RHBZ#1147876).
Richard W.M. Jones [Tue, 17 Oct 2017 13:47:09 +0000 (14:47 +0100)]
Recognize ppc64le (little endian) virtualization (RHBZ#1147876).

Tested by Laurent Vivier, see:
https://bugzilla.redhat.com/show_bug.cgi?id=1147876#c35 & ff.

7 years agoAs xen pv guest can access cpuid from Intel CPUs started IvyBridge onwards have CPUID...
xiliang [Sat, 17 Jun 2017 16:33:28 +0000 (00:33 +0800)]
As xen pv guest can access cpuid from Intel CPUs started IvyBridge onwards have CPUID Faulting, added one more check in virt-what.

7 years agoRemove bashisms
Guido Günther [Fri, 4 Aug 2017 15:02:08 +0000 (12:02 -0300)]
Remove bashisms

Use [ instead of [[ so we fall back to test if necessary:

     http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html

Gbp-Pq: Name Remove-bashisms.patch

7 years agoMissing have_cpuinfo check.
Jasper Lievisse Adriaanse [Thu, 10 Aug 2017 07:44:01 +0000 (08:44 +0100)]
Missing have_cpuinfo check.

7 years agoVersion 1.18. v1.18
Richard W.M. Jones [Mon, 31 Jul 2017 14:35:11 +0000 (15:35 +0100)]
Version 1.18.

7 years agoAdd new ldoms binaries to EXTRA_DIST.
Richard W.M. Jones [Mon, 31 Jul 2017 14:34:08 +0000 (15:34 +0100)]
Add new ldoms binaries to EXTRA_DIST.

Fixes commit 0e25bd8297ddedec14a260b25a6347ccca784df3
and commit dc0c2972e178a6de9ee87501acca54447ea9c699.

7 years agoVersion 1.17. v1.17
Richard W.M. Jones [Mon, 31 Jul 2017 14:28:45 +0000 (15:28 +0100)]
Version 1.17.

7 years agoppc64: Test ${root}/proc/device-tree/hypervisor instead of real file.
Richard W.M. Jones [Mon, 31 Jul 2017 14:19:52 +0000 (15:19 +0100)]
ppc64: Test ${root}/proc/device-tree/hypervisor instead of real file.

Fixes commit 50153230d19401fe47fcfd19d7ca0a2623c1ff09.

7 years agotests: Fix ldoms test so it doesn't test the host.
Richard W.M. Jones [Mon, 31 Jul 2017 14:04:28 +0000 (15:04 +0100)]
tests: Fix ldoms test so it doesn't test the host.

Fixes commit dc0c2972e178a6de9ee87501acca54447ea9c699.

7 years agoDocument ‘aws’ meaning Amazon Web Services cloud guest.
Richard W.M. Jones [Mon, 31 Jul 2017 13:32:51 +0000 (14:32 +0100)]
Document ‘aws’ meaning Amazon Web Services cloud guest.

Updates commit dc32228184622b28f412f527c0f353347db029b8.

7 years agoFix EXTRA_DIST to match actual contents of tests directory. v1.16
Richard W.M. Jones [Mon, 31 Jul 2017 13:19:46 +0000 (14:19 +0100)]
Fix EXTRA_DIST to match actual contents of tests directory.

7 years agoVersion 1.16
Richard W.M. Jones [Mon, 31 Jul 2017 13:14:06 +0000 (14:14 +0100)]
Version 1.16

7 years agoAdd LDoms Support.
Darren Kenny [Tue, 4 Jul 2017 07:26:01 +0000 (08:26 +0100)]
Add LDoms Support.

The current version of virt-what does not support discovery of any
Logical Domains (LDoms) variants. This patch adds that support.

Orabug: 26106813

Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-By: Liam Merwick <liam.merwick@oracle.com>
Reviewed-By: Rashmi Narasimhan <rashmi.narasimhan@oracle.com>
7 years agoUpdate virt-what to detect AWS via dmidecode data.
Qi Guo [Flos] [Wed, 19 Jul 2017 15:39:29 +0000 (16:39 +0100)]
Update virt-what to detect AWS via dmidecode data.

7 years agovirt-what: recognize OpenBSD vmm
Jasper Lievisse Adriaanse [Sat, 1 Jul 2017 11:12:46 +0000 (13:12 +0200)]
virt-what: recognize OpenBSD vmm

Hi,

Please find attached a patch for virt-what to recognize the OpenBSD VMM
hypervisor.

For more information on vmm, please refer to:
- http://man.openbsd.org/vmm.4
- https://www.openbsd.org/papers/asiabsdcon2017-vmm-slides.pdf

>From 837390b5afbb9253a62b15208d6fb4cbbbecabf1 Mon Sep 17 00:00:00 2001
From: Jasper Lievisse Adriaanse <j@jasper.la>
Date: Sat, 17 Jun 2017 21:17:39 +0200
Subject: [PATCH] vmm detection (OpenBSD hypervisor)

7 years agoUpdate to detect QEMU via 'TCGTCGTCGTCG' CPUID
Daniel P. Berrange [Tue, 18 Jul 2017 12:45:09 +0000 (13:45 +0100)]
Update to detect QEMU via 'TCGTCGTCGTCG' CPUID

QEMU >= 2.10 will start reporting the string "TCGTCGTCGTCG"
for CPUID queries when running under TCG only (KVM signature
is unchanged)

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoAdd support for KVM on System Z
Thomas Huth [Tue, 4 Jul 2017 14:20:40 +0000 (16:20 +0200)]
Add support for KVM on System Z

KVM on System Z can be discovered in the same way as z/VM, by
looking at the "VM* Control Program" lines in /proc/sysinfo.

Signed-off-by: Thomas Huth <thuth@redhat.com>
7 years agoExport internal PATH variable (RHBZ#1467878).
Mark Huth [Wed, 5 Jul 2017 11:11:32 +0000 (21:11 +1000)]
Export internal PATH variable (RHBZ#1467878).

- Fixes virt-what failing if it's started without an environment, eg:
  $ env -i /sbin/virt-what
  ... or with python subprocess.Popen, eg:
  p = subprocess.Popen('/sbin/virt-what', shell=False, ... , env={})

7 years agoDetect KVM property when running on POWER (RHBZ#1455676).
Thomas Huth [Thu, 29 Jun 2017 10:27:42 +0000 (11:27 +0100)]
Detect KVM property when running on POWER (RHBZ#1455676).

QEMU on ppc64 adds an additional property in the device tree if
running with KVM, so you could check that property for the string
"linux,kvm" to see if KVM is enabled:

0000000: 6c69 6e75 782c 6b76 6d00                 linux,kvm.

7 years agoRevert "Print 'qemu' fact when running in qemu environment on POWER 9 (RHBZ#1455676)."
Richard W.M. Jones [Thu, 29 Jun 2017 10:22:21 +0000 (11:22 +0100)]
Revert "Print 'qemu' fact when running in qemu environment on POWER 9 (RHBZ#1455676)."

This reverts commit 15314ad0a6e3764f070b60f6df02a2f881b09fce.

7 years agoPrint 'qemu' fact when running in qemu environment on POWER 9 (RHBZ#1455676).
Richard W.M. Jones [Thu, 29 Jun 2017 09:07:38 +0000 (10:07 +0100)]
Print 'qemu' fact when running in qemu environment on POWER 9 (RHBZ#1455676).

Thanks Nageswara R. Sastry

8 years agoAdd documentation for bhyve.
Richard W.M. Jones [Mon, 10 Oct 2016 14:15:41 +0000 (15:15 +0100)]
Add documentation for bhyve.

8 years agoAdd detection of bhyve (FreeBSD hypervisor)
Leonardo Brondani Schenkel [Sat, 17 Sep 2016 12:59:52 +0000 (12:59 +0000)]
Add detection of bhyve (FreeBSD hypervisor)

8 years agoAdd detection of Red Hat Enterprise Virtualization hypervisor (RHBZ#1249438).
Richard W.M. Jones [Mon, 22 Aug 2016 11:30:25 +0000 (12:30 +0100)]
Add detection of Red Hat Enterprise Virtualization hypervisor (RHBZ#1249438).

Thanks: Xianghua Chen

8 years agoUpdate the previous commit to use <system>-<virt> standard for facts.
Richard W.M. Jones [Mon, 20 Jun 2016 12:14:53 +0000 (13:14 +0100)]
Update the previous commit to use <system>-<virt> standard for facts.

Also I renamed ppc64 to power, since that is the official IBM name.

8 years agoAdd support for detecting ppc64 LPAR as virt guests.
Adrian Likins [Mon, 20 Jun 2016 11:57:27 +0000 (12:57 +0100)]
Add support for detecting ppc64 LPAR as virt guests.

https://bugzilla.redhat.com/show_bug.cgi?id=1072524#c13

9 years agoqemu/kvm: dmidecode: look for 'KVM'
Andrew Jones [Tue, 27 Oct 2015 17:16:04 +0000 (18:16 +0100)]
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.

9 years agoqemu/kvm: try dmidecode on all targets
Andrew Jones [Tue, 27 Oct 2015 17:16:03 +0000 (18:16 +0100)]
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.

9 years agotrivial: virt-what.in doesn't use tabs
Andrew Jones [Tue, 27 Oct 2015 17:16:02 +0000 (18:16 +0100)]
trivial: virt-what.in doesn't use tabs

9 years agoAdd oVirt (RHBZ#1249438).
Richard W.M. Jones [Mon, 3 Aug 2015 11:23:13 +0000 (12:23 +0100)]
Add oVirt (RHBZ#1249438).

9 years agotrivial: comment fixup
Andrew Jones [Tue, 22 Sep 2015 16:29:08 +0000 (18:29 +0200)]
trivial: comment fixup

dmidecode does now exist on non-PC architectures.

9 years agoAdd QEMU/KVM detection for ACPI-boot ARM
Andrew Jones [Tue, 22 Sep 2015 13:54:55 +0000 (15:54 +0200)]
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 <drjones@redhat.com>
9 years agoUpdate copyright years.
Richard W.M. Jones [Mon, 3 Aug 2015 11:23:05 +0000 (12:23 +0100)]
Update copyright years.

9 years agoVersion 1.15 1.15
Richard W.M. Jones [Tue, 21 Apr 2015 11:10:44 +0000 (12:10 +0100)]
Version 1.15

9 years agoxen-arm: Fix path in EXTRA_DIST.
Richard W.M. Jones [Tue, 21 Apr 2015 11:12:45 +0000 (12:12 +0100)]
xen-arm: Fix path in EXTRA_DIST.

9 years agoAdd ARM support
Andrew Jones [Fri, 27 Mar 2015 20:19:00 +0000 (21:19 +0100)]
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 <drjones@redhat.com>
9 years agoAdd lkvm detection
Andrew Jones [Fri, 27 Mar 2015 20:18:59 +0000 (21:18 +0100)]
Add lkvm detection

Signed-off-by: Andrew Jones <drjones@redhat.com>
10 years agoAdd space before parens in function defns for readability.
Richard W.M. Jones [Tue, 16 Sep 2014 18:02:18 +0000 (19:02 +0100)]
Add space before parens in function defns for readability.

10 years agobuild: use portable Makefile variables
A. Gordon [Mon, 15 Sep 2014 19:51:50 +0000 (15:51 -0400)]
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.

10 years agovirt-what.in: make option processing portable
Assaf Gordon [Mon, 15 Sep 2014 19:34:06 +0000 (19:34 +0000)]
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.

10 years agovirt-what.in: verify files exists before grepping them
Assaf Gordon [Mon, 15 Sep 2014 19:15:19 +0000 (19:15 +0000)]
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.

10 years agovirt-what.in: warn about missing cpuid-virt helper program
Assaf Gordon [Mon, 15 Sep 2014 19:08:20 +0000 (19:08 +0000)]
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.

10 years agovirt-what.in: get effective uid in a portable way
Assaf Gordon [Mon, 15 Sep 2014 18:58:19 +0000 (18:58 +0000)]
virt-what.in: get effective uid in a portable way

$EUID is bash-specific. Use the POSIX-compatible 'id -u' instead.