import virt-what-1.18-13.el8

This commit is contained in:
CentOS Sources 2022-05-10 03:20:25 -04:00 committed by Stepan Oksanichenko
parent 2221d77e3e
commit ba49f522f4
26 changed files with 170 additions and 50 deletions

View File

@ -1,7 +1,7 @@
From eefc1e7e3dd8fb422baf0f13aec1df9880541b83 Mon Sep 17 00:00:00 2001 From eefc1e7e3dd8fb422baf0f13aec1df9880541b83 Mon Sep 17 00:00:00 2001
From: Jasper Lievisse Adriaanse <bug@jasper.la> From: Jasper Lievisse Adriaanse <bug@jasper.la>
Date: Thu, 10 Aug 2017 08:44:01 +0100 Date: Thu, 10 Aug 2017 08:44:01 +0100
Subject: [PATCH 01/22] Missing have_cpuinfo check. Subject: [PATCH 01/25] Missing have_cpuinfo check.
--- ---
virt-what.in | 2 +- virt-what.in | 2 +-
@ -21,5 +21,5 @@ index 8c27b11..9050035 100644
fi fi
fi fi
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 9d90704a05dee7704470eff818a1c44aeef6c880 Mon Sep 17 00:00:00 2001 From 9d90704a05dee7704470eff818a1c44aeef6c880 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org> From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Fri, 4 Aug 2017 12:02:08 -0300 Date: Fri, 4 Aug 2017 12:02:08 -0300
Subject: [PATCH 02/22] Remove bashisms Subject: [PATCH 02/25] Remove bashisms
Use [ instead of [[ so we fall back to test if necessary: Use [ instead of [[ so we fall back to test if necessary:
@ -44,5 +44,5 @@ index 9050035..a05e0db 100644
fi fi
fi fi
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From a821dc9961d457c086fffcc16a911cb6f9f8659a Mon Sep 17 00:00:00 2001 From a821dc9961d457c086fffcc16a911cb6f9f8659a Mon Sep 17 00:00:00 2001
From: xiliang <xiliang@redhat.com> From: xiliang <xiliang@redhat.com>
Date: Sun, 18 Jun 2017 00:33:28 +0800 Date: Sun, 18 Jun 2017 00:33:28 +0800
Subject: [PATCH 03/22] As xen pv guest can access cpuid from Intel CPUs Subject: [PATCH 03/25] As xen pv guest can access cpuid from Intel CPUs
started IvyBridge onwards have CPUID Faulting, added one more check in started IvyBridge onwards have CPUID Faulting, added one more check in
virt-what. virt-what.
@ -32,5 +32,5 @@ index a05e0db..247348e 100644
# Check for AWS # Check for AWS
if echo "$dmi" | grep -q 'Version: [0-9]\.[0-9]\.amazon'; then if echo "$dmi" | grep -q 'Version: [0-9]\.[0-9]\.amazon'; then
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 7db94c8fe63f2c7ec3ac27cc5ff54ec1e1686aeb Mon Sep 17 00:00:00 2001 From 7db94c8fe63f2c7ec3ac27cc5ff54ec1e1686aeb Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 17 Oct 2017 14:47:09 +0100 Date: Tue, 17 Oct 2017 14:47:09 +0100
Subject: [PATCH 04/22] Recognize ppc64le (little endian) virtualization Subject: [PATCH 04/25] Recognize ppc64le (little endian) virtualization
(RHBZ#1147876). (RHBZ#1147876).
Tested by Laurent Vivier, see: Tested by Laurent Vivier, see:
@ -24,5 +24,5 @@ index 247348e..29b7b0d 100644
if grep -q 'model.*emulated by qemu' "${root}/proc/cpuinfo"; then if grep -q 'model.*emulated by qemu' "${root}/proc/cpuinfo"; then
echo ibm_power-kvm echo ibm_power-kvm
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 52870e8a264653d7921e8a4edff56d4b050614d8 Mon Sep 17 00:00:00 2001 From 52870e8a264653d7921e8a4edff56d4b050614d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org> From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Sat, 27 Jan 2018 13:11:36 +0100 Date: Sat, 27 Jan 2018 13:11:36 +0100
Subject: [PATCH 05/22] Determine architecture via 'uname -m' Subject: [PATCH 05/25] Determine architecture via 'uname -m'
'uname -p' only gives unknown on x86_64, i386, arm6l (rpi) and aarch64 'uname -p' only gives unknown on x86_64, i386, arm6l (rpi) and aarch64
(scaleways). (scaleways).
@ -26,5 +26,5 @@ index 29b7b0d..2011ff4 100644
# Check for VMware. # Check for VMware.
# cpuid check added by Chetan Loke. # cpuid check added by Chetan Loke.
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From d7fd8a7843030d2b1719353edfcd49dba3000122 Mon Sep 17 00:00:00 2001 From d7fd8a7843030d2b1719353edfcd49dba3000122 Mon Sep 17 00:00:00 2001
From: Jasper Lievisse Adriaanse <jasper@humppa.nl> From: Jasper Lievisse Adriaanse <jasper@humppa.nl>
Date: Wed, 25 Apr 2018 16:41:32 +0200 Date: Wed, 25 Apr 2018 16:41:32 +0200
Subject: [PATCH 06/22] Allow using sysctl, for example when /proc isn't Subject: [PATCH 06/25] Allow using sysctl, for example when /proc isn't
available available
--- ---
@ -40,5 +40,5 @@ index 2011ff4..d037a99 100644
# This is known to fail for qemu with the explicit -cpu # This is known to fail for qemu with the explicit -cpu
# option, since /proc/cpuinfo will not contain the QEMU # option, since /proc/cpuinfo will not contain the QEMU
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 5efe9f7a58cd0cdc6f4c279c7f0a69e57fbda56f Mon Sep 17 00:00:00 2001 From 5efe9f7a58cd0cdc6f4c279c7f0a69e57fbda56f Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 28 Aug 2018 18:32:41 +0100 Date: Tue, 28 Aug 2018 18:32:41 +0100
Subject: [PATCH 07/22] Replace == with = since the former is a bash-ism. Subject: [PATCH 07/25] Replace == with = since the former is a bash-ism.
Thanks: Eric Blake. Thanks: Eric Blake.
@ -24,5 +24,5 @@ index d037a99..a2f8f19 100644
fail () { fail () {
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 147c648e950ef45b7a5b7b3e8cb30b89c435593b Mon Sep 17 00:00:00 2001 From 147c648e950ef45b7a5b7b3e8cb30b89c435593b Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 31 Oct 2018 15:04:24 +0000 Date: Wed, 31 Oct 2018 15:04:24 +0000
Subject: [PATCH 08/22] aws: Detect AWS from dmidecode information. Subject: [PATCH 08/25] aws: Detect AWS from dmidecode information.
Move the AWS detection out from under Xen. AWS runs on KVM and Move the AWS detection out from under Xen. AWS runs on KVM and
baremetal these days. The dmidecode information for KVM and baremetal baremetal these days. The dmidecode information for KVM and baremetal
@ -75,5 +75,5 @@ index ebfc190..5a0bdfc 100644
=item B<bhyve> =item B<bhyve>
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 4bceb38a6102ca95bde79205efaa643a0824d3a2 Mon Sep 17 00:00:00 2001 From 4bceb38a6102ca95bde79205efaa643a0824d3a2 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 31 Oct 2018 15:35:34 +0000 Date: Wed, 31 Oct 2018 15:35:34 +0000
Subject: [PATCH 09/22] tests: Fix tests when run on AWS. Subject: [PATCH 09/25] tests: Fix tests when run on AWS.
When running on AWS two of the tests failed. This was because the When running on AWS two of the tests failed. This was because the
tests did _not_ include a working dmidecode binary, hence the platform tests did _not_ include a working dmidecode binary, hence the platform
@ -28,5 +28,5 @@ diff --git a/tests/ppc64-baremetal/sbin/dmidecode b/tests/ppc64-baremetal/sbin/d
old mode 100644 old mode 100644
new mode 100755 new mode 100755
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 129a25f9854930928351c8cc3913a5b9a1c558b4 Mon Sep 17 00:00:00 2001 From 129a25f9854930928351c8cc3913a5b9a1c558b4 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 31 Oct 2018 15:23:45 +0000 Date: Wed, 31 Oct 2018 15:23:45 +0000
Subject: [PATCH 10/22] aws: Add regression test for AWS on KVM on x86_64 Subject: [PATCH 10/25] aws: Add regression test for AWS on KVM on x86_64
architecture. architecture.
--- ---
@ -286,5 +286,5 @@ index 0000000..db4c19f
+ exit 1 + exit 1
+fi +fi
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 298a15ead59c2dbeb9b2fabe7fb502100fdd4dc7 Mon Sep 17 00:00:00 2001 From 298a15ead59c2dbeb9b2fabe7fb502100fdd4dc7 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 31 Oct 2018 15:43:20 +0000 Date: Wed, 31 Oct 2018 15:43:20 +0000
Subject: [PATCH 11/22] aws: Add regression test for AWS on baremetal on x86_64 Subject: [PATCH 11/25] aws: Add regression test for AWS on baremetal on x86_64
architecture. architecture.
--- ---
@ -3231,5 +3231,5 @@ index 0000000..d456163
+ exit 1 + exit 1
+fi +fi
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 350291e1ca417eab9d2aa2408589f0259cac007c Mon Sep 17 00:00:00 2001 From 350291e1ca417eab9d2aa2408589f0259cac007c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 31 Oct 2018 15:23:45 +0000 Date: Wed, 31 Oct 2018 15:23:45 +0000
Subject: [PATCH 12/22] aws: Add regression test for AWS on Xen on x86_64 Subject: [PATCH 12/25] aws: Add regression test for AWS on Xen on x86_64
architecture. architecture.
--- ---
@ -354,5 +354,5 @@ index 0000000..22b7f83
+ exit 1 + exit 1
+fi +fi
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From f25e07d43db40355b321493f78758ea058fa3849 Mon Sep 17 00:00:00 2001 From f25e07d43db40355b321493f78758ea058fa3849 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 31 Oct 2018 15:23:45 +0000 Date: Wed, 31 Oct 2018 15:23:45 +0000
Subject: [PATCH 13/22] aws: Add regression test for AWS on KVM on ARM Subject: [PATCH 13/25] aws: Add regression test for AWS on KVM on ARM
architecture. architecture.
--- ---
@ -240,5 +240,5 @@ index 0000000..8875421
+ exit 1 + exit 1
+fi +fi
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 56427ce169d5a6dc46ed6c6555ee3f7c4e0843d6 Mon Sep 17 00:00:00 2001 From 56427ce169d5a6dc46ed6c6555ee3f7c4e0843d6 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 3 Oct 2019 09:08:19 +0100 Date: Thu, 3 Oct 2019 09:08:19 +0100
Subject: [PATCH 14/22] build: Remove *~ files on make clean. Subject: [PATCH 14/25] build: Remove *~ files on make clean.
--- ---
Makefile.am | 2 +- Makefile.am | 2 +-
@ -21,5 +21,5 @@ index 67502fc..48fd518 100644
AM_CPPFLAGS = -Wall AM_CPPFLAGS = -Wall
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From e3eeddbc857a5647135c42c97be75198929a8ce1 Mon Sep 17 00:00:00 2001 From e3eeddbc857a5647135c42c97be75198929a8ce1 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 3 Oct 2019 09:53:49 +0100 Date: Thu, 3 Oct 2019 09:53:49 +0100
Subject: [PATCH 15/22] Arrange tests in subdirectories. Subject: [PATCH 15/25] Arrange tests in subdirectories.
This simplifies and isolates each test. This simplifies and isolates each test.
--- ---
@ -2382,5 +2382,5 @@ index 0620db0..a22f311 100755
ibm_systemz-zvm" ibm_systemz-zvm"
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 5c2c251d9aae98e6a629b966bdd8cae2aa1dedaf Mon Sep 17 00:00:00 2001 From 5c2c251d9aae98e6a629b966bdd8cae2aa1dedaf Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 3 Oct 2019 10:16:08 +0100 Date: Thu, 3 Oct 2019 10:16:08 +0100
Subject: [PATCH 16/22] build: Add .gitignore to tarball. Subject: [PATCH 16/25] build: Add .gitignore to tarball.
Mainly to keep maintainer-check-extra-dist happy. Mainly to keep maintainer-check-extra-dist happy.
--- ---
@ -22,5 +22,5 @@ index b62738f..1cb73b7 100644
SUBDIRS = . tests SUBDIRS = . tests
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From b6161b67b0bd542169e13cdfa0488a0266e3ae7a Mon Sep 17 00:00:00 2001 From b6161b67b0bd542169e13cdfa0488a0266e3ae7a Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 3 Oct 2019 10:13:43 +0100 Date: Thu, 3 Oct 2019 10:13:43 +0100
Subject: [PATCH 17/22] maintainer: Add rules for maintainers. Subject: [PATCH 17/25] maintainer: Add rules for maintainers.
Adds: Adds:
make maintainer-check-extra-dist make maintainer-check-extra-dist
@ -47,5 +47,5 @@ index 1cb73b7..5435132 100644
+maintainer-tag: +maintainer-tag:
+ git tag -a v$(VERSION) -m "Version $(VERSION)." -f + git tag -a v$(VERSION) -m "Version $(VERSION)." -f
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From a5471559e7398418f1bb9c538a7bfc8f39e9ae98 Mon Sep 17 00:00:00 2001 From a5471559e7398418f1bb9c538a7bfc8f39e9ae98 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 4 Oct 2019 15:57:42 +0300 Date: Fri, 4 Oct 2019 15:57:42 +0300
Subject: [PATCH 18/22] Fix virt-what-cpuid-helper. Subject: [PATCH 18/25] Fix virt-what-cpuid-helper.
The value returned in %eax is the max_entry (eg. 0x40000000 The value returned in %eax is the max_entry (eg. 0x40000000
if there are no further leafs). However it is not reliable. if there are no further leafs). However it is not reliable.
@ -114,5 +114,5 @@ index 7812545..0cd4a6f 100644
} }
} }
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 01ea13d9813df93e294b0d9776d4cefd54b1609b Mon Sep 17 00:00:00 2001 From 01ea13d9813df93e294b0d9776d4cefd54b1609b Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 4 Oct 2019 16:25:55 +0300 Date: Fri, 4 Oct 2019 16:25:55 +0300
Subject: [PATCH 19/22] Add support for Nutanix Acropolis Hypervisor (AHV) Subject: [PATCH 19/25] Add support for Nutanix Acropolis Hypervisor (AHV)
(RHBZ#1756381). (RHBZ#1756381).
Thanks: Cristian Seres for providing access to a guest. Thanks: Cristian Seres for providing access to a guest.
@ -401,5 +401,5 @@ index 5a0bdfc..ea5cb77 100644
The guest appears to be running inside an OpenVZ or Virtuozzo The guest appears to be running inside an OpenVZ or Virtuozzo
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From e0443f1fc78f2a79c073dbdf4133bec41c4c0591 Mon Sep 17 00:00:00 2001 From e0443f1fc78f2a79c073dbdf4133bec41c4c0591 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 4 Oct 2019 18:30:01 +0100 Date: Fri, 4 Oct 2019 18:30:01 +0100
Subject: [PATCH 20/22] helper: Fix KVM signature. Subject: [PATCH 20/25] helper: Fix KVM signature.
Thanks: Paolo Bonzini. Thanks: Paolo Bonzini.
--- ---
@ -34,5 +34,5 @@ index 0cd4a6f..9c6cdb2 100644
strcmp (sig, "Microsoft Hv") == 0 || strcmp (sig, "Microsoft Hv") == 0 ||
strcmp (sig, "OpenBSDVMM58") == 0 || strcmp (sig, "OpenBSDVMM58") == 0 ||
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 71ef45e9543278e9920e449b71e0da269662ebc9 Mon Sep 17 00:00:00 2001 From 71ef45e9543278e9920e449b71e0da269662ebc9 Mon Sep 17 00:00:00 2001
From: willem van de velde <williamvdvelde@gmail.com> From: willem van de velde <williamvdvelde@gmail.com>
Date: Tue, 22 Oct 2019 11:58:01 +0100 Date: Tue, 22 Oct 2019 11:58:01 +0100
Subject: [PATCH 21/22] Fix incorrect detection of MS Surfacebook 2 as a Subject: [PATCH 21/25] Fix incorrect detection of MS Surfacebook 2 as a
virtual machine. virtual machine.
--- ---
@ -23,5 +23,5 @@ index 9eafa05..a61ce91 100644
fi fi
-- --
2.32.0 2.18.4

View File

@ -1,7 +1,7 @@
From 8640dad5eb60eced313359e7ecea19b07d77242f Mon Sep 17 00:00:00 2001 From 8640dad5eb60eced313359e7ecea19b07d77242f Mon Sep 17 00:00:00 2001
From: Razvan Corneliu <razvan.vilt@linux360.ro> From: Razvan Corneliu <razvan.vilt@linux360.ro>
Date: Mon, 10 May 2021 21:02:27 +0100 Date: Mon, 10 May 2021 21:02:27 +0100
Subject: [PATCH 22/22] Add support for VMware ESXi on ARM Subject: [PATCH 22/25] Add support for VMware ESXi on ARM
Virt-what doesn't recognize VMware VMs for AARCH64/ARM (with licensing 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 implications in ESXi Fling for ARM and Fusion v.Next for ARM). I've
@ -263,5 +263,5 @@ index a61ce91..59743c3 100644
elif [ "$arch" = "ia64" ]; then elif [ "$arch" = "ia64" ]; then
if [ -d "${root}/sys/bus/xen" -a ! -d "${root}/sys/bus/xen-backend" ]; then if [ -d "${root}/sys/bus/xen" -a ! -d "${root}/sys/bus/xen-backend" ]; then
-- --
2.32.0 2.18.4

View File

@ -0,0 +1,48 @@
From a24df0c780aaf74f0ed408bc55386b9f933fb7aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
Date: Sun, 1 Dec 2019 07:58:04 +0200
Subject: [PATCH 23/25] docker: Check for /.dockerenv too
/.dockerinit may no longer exist.
Ref https://github.com/moby/moby/issues/18355
(cherry picked from commit e2c49cda221f95cb65b1b3ac3ae15aa41d92f519)
---
tests/docker/.dockerenv | 0
tests/docker/Makefile.am | 1 +
virt-what.in | 2 +-
3 files changed, 2 insertions(+), 1 deletion(-)
create mode 100644 tests/docker/.dockerenv
diff --git a/tests/docker/.dockerenv b/tests/docker/.dockerenv
new file mode 100644
index 0000000..e69de29
diff --git a/tests/docker/Makefile.am b/tests/docker/Makefile.am
index e0ea991..e2a95d8 100644
--- a/tests/docker/Makefile.am
+++ b/tests/docker/Makefile.am
@@ -21,6 +21,7 @@ TESTS = test.sh
EXTRA_DIST = \
test.sh \
+ .dockerenv \
.dockerinit \
proc/cpuinfo \
proc/self/status \
diff --git a/virt-what.in b/virt-what.in
index 59743c3..900a05d 100644
--- a/virt-what.in
+++ b/virt-what.in
@@ -349,7 +349,7 @@ if ! "$skip_lkvm"; then
fi
# Check for Docker.
-if [ -f "${root}/.dockerinit" ]; then
+if [ -f "${root}/.dockerenv" ] || [ -f "${root}/.dockerinit" ]; then
echo docker
fi
--
2.18.4

View File

@ -0,0 +1,63 @@
From 6831ccb71a7b19c6e5cb970026cbffff39928e2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
Date: Sun, 1 Dec 2019 08:21:32 +0200
Subject: [PATCH 24/25] docker: Lookup from /proc/self/cgroup too
Refs https://github.com/moby/moby/issues/18355
(cherry picked from commit 57f0c3cc6a7e631f644d67f05b002c6004bb6601)
---
tests/docker/Makefile.am | 1 +
tests/docker/proc/self/cgroup | 13 +++++++++++++
virt-what.in | 3 ++-
3 files changed, 16 insertions(+), 1 deletion(-)
create mode 100644 tests/docker/proc/self/cgroup
diff --git a/tests/docker/Makefile.am b/tests/docker/Makefile.am
index e2a95d8..401f372 100644
--- a/tests/docker/Makefile.am
+++ b/tests/docker/Makefile.am
@@ -24,6 +24,7 @@ EXTRA_DIST = \
.dockerenv \
.dockerinit \
proc/cpuinfo \
+ proc/self/cgroup \
proc/self/status \
sbin/dmidecode \
sbin/uname \
diff --git a/tests/docker/proc/self/cgroup b/tests/docker/proc/self/cgroup
new file mode 100644
index 0000000..5547637
--- /dev/null
+++ b/tests/docker/proc/self/cgroup
@@ -0,0 +1,13 @@
+12:devices:/docker/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
+11:blkio:/docker/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
+10:perf_event:/docker/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
+9:pids:/docker/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
+8:cpuset:/docker/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
+7:rdma:/
+6:hugetlb:/docker/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
+5:net_cls,net_prio:/docker/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
+4:memory:/docker/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
+3:freezer:/docker/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
+2:cpu,cpuacct:/docker/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
+1:name=systemd:/docker/2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
+0::/system.slice/containerd.service
diff --git a/virt-what.in b/virt-what.in
index 900a05d..6330fd0 100644
--- a/virt-what.in
+++ b/virt-what.in
@@ -349,7 +349,8 @@ if ! "$skip_lkvm"; then
fi
# Check for Docker.
-if [ -f "${root}/.dockerenv" ] || [ -f "${root}/.dockerinit" ]; then
+if [ -f "${root}/.dockerenv" ] || [ -f "${root}/.dockerinit" ] || \
+ grep -qF /docker/ "${root}/proc/self/cgroup" 2>/dev/null; then
echo docker
fi
--
2.18.4

View File

@ -1,10 +1,12 @@
From 60d903fbb7653bc9754228bdab4c6933fcda1e72 Mon Sep 17 00:00:00 2001 From 88eb2b7fbd7e6af1cd1860c3f2023ee7b9125d37 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com> From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 13 Apr 2021 09:35:07 +0100 Date: Tue, 13 Apr 2021 09:35:07 +0100
Subject: [PATCH] Simplify and fix invocation of cpuid. Subject: [PATCH 25/25] Simplify and fix invocation of cpuid.
Fixes a crash on some platforms identified by Yongkui Guo in Fixes a crash on some platforms identified by Yongkui Guo in
https://bugzilla.redhat.com/show_bug.cgi?id=1756381#c15 https://bugzilla.redhat.com/show_bug.cgi?id=1756381#c15
(cherry picked from commit 60d903fbb7653bc9754228bdab4c6933fcda1e72)
--- ---
virt-what-cpuid-helper.c | 24 ++++++++++++++++-------- virt-what-cpuid-helper.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-) 1 file changed, 16 insertions(+), 8 deletions(-)
@ -56,5 +58,5 @@ index 9c6cdb2..fdceb62 100644
puts (sig); puts (sig);
break; break;
-- --
2.29.0.rc2 2.18.4

View File

@ -1,6 +1,6 @@
Name: virt-what Name: virt-what
Version: 1.18 Version: 1.18
Release: 12%{?dist} Release: 13%{?dist}
Summary: Detect if we are running in a virtual machine Summary: Detect if we are running in a virtual machine
License: GPLv2+ License: GPLv2+
@ -14,7 +14,7 @@ Source1: gitignore
# Patches from upstream since 1.18 was released. # Patches from upstream since 1.18 was released.
# NB: These patches are also stored in this upstream branch: # NB: These patches are also stored in this upstream branch:
# http://git.annexia.org/?p=virt-what.git;a=shortlog;h=refs/heads/rhel-8.2 # http://git.annexia.org/?p=virt-what.git;a=shortlog;h=refs/heads/rhel-8.6
Patch0001: 0001-Missing-have_cpuinfo-check.patch Patch0001: 0001-Missing-have_cpuinfo-check.patch
Patch0002: 0002-Remove-bashisms.patch Patch0002: 0002-Remove-bashisms.patch
Patch0003: 0003-As-xen-pv-guest-can-access-cpuid-from-Intel-CPUs-sta.patch Patch0003: 0003-As-xen-pv-guest-can-access-cpuid-from-Intel-CPUs-sta.patch
@ -42,10 +42,13 @@ Patch0020: 0020-helper-Fix-KVM-signature.patch
Patch0021: 0021-Fix-incorrect-detection-of-MS-Surfacebook-2-as-a-vir.patch Patch0021: 0021-Fix-incorrect-detection-of-MS-Surfacebook-2-as-a-vir.patch
# Support for VMware on aarch64 (RHBZ#1959154). # Support for VMware on aarch64 (RHBZ#1959154).
Patch0022: 0022-Add-support-for-VMware-ESXi-on-ARM.patch Patch0022: 0022-Add-support-for-VMware-ESXi-on-ARM.patch
# Support for Docker (RHBZ#2000834).
Patch0023: 0023-docker-Check-for-.dockerenv-too.patch
Patch0024: 0024-docker-Lookup-from-proc-self-cgroup-too.patch
# Fix crash on non-KVM platforms through incorrect use of CPUID in # Fix crash on non-KVM platforms through incorrect use of CPUID in
# patch 0018 (https://bugzilla.redhat.com/show_bug.cgi?id=1756381#c15). # patch 0018 (https://bugzilla.redhat.com/show_bug.cgi?id=1756381#c15).
Patch0023: 0001-Simplify-and-fix-invocation-of-cpuid.patch Patch0025: 0025-Simplify-and-fix-invocation-of-cpuid.patch
# Patches touch Makefile.am: # Patches touch Makefile.am:
BuildRequires: autoconf, automake BuildRequires: autoconf, automake
@ -158,6 +161,10 @@ fi
%changelog %changelog
* Mon Sep 06 2021 Richard W.M. Jones <rjones@redhat.com> - 1.18-13
- Support for Docker
resolves: rhbz#2000834
* Fri Jun 18 2021 Richard W.M. Jones <rjones@redhat.com> - 1.18-12 * Fri Jun 18 2021 Richard W.M. Jones <rjones@redhat.com> - 1.18-12
- Support for VMware on aarch64 - Support for VMware on aarch64
resolves: rhbz#1959154 resolves: rhbz#1959154