Include upstream patches since 1.18 was released.

This commit is contained in:
Richard W.M. Jones 2017-10-17 12:16:07 +01:00
parent 6a8a9d2221
commit 98f12528e9
4 changed files with 118 additions and 2 deletions

View File

@ -0,0 +1,25 @@
From eefc1e7e3dd8fb422baf0f13aec1df9880541b83 Mon Sep 17 00:00:00 2001
From: Jasper Lievisse Adriaanse <bug@jasper.la>
Date: Thu, 10 Aug 2017 08:44:01 +0100
Subject: [PATCH 1/3] Missing have_cpuinfo check.
---
virt-what.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virt-what.in b/virt-what.in
index 8c27b11..9050035 100644
--- a/virt-what.in
+++ b/virt-what.in
@@ -308,7 +308,7 @@ if ! "$skip_qemu_kvm"; then
# option, since /proc/cpuinfo will not contain the QEMU
# string. QEMU 2.10 added a new CPUID leaf, so this
# problem only triggered for older QEMU
- if grep -q 'QEMU' "${root}/proc/cpuinfo"; then
+ if have_cpuinfo && grep -q 'QEMU' "${root}/proc/cpuinfo"; then
echo qemu
fi
fi
--
2.13.2

View File

@ -0,0 +1,48 @@
From 9d90704a05dee7704470eff818a1c44aeef6c880 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Fri, 4 Aug 2017 12:02:08 -0300
Subject: [PATCH 2/3] 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
---
virt-what.in | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/virt-what.in b/virt-what.in
index 9050035..a05e0db 100644
--- a/virt-what.in
+++ b/virt-what.in
@@ -360,20 +360,20 @@ if [ "$cpuid" = "OpenBSDVMM58" ]; then
fi
# Check for LDoms
-if [[ "$arch" == sparc* && -e ${root}/dev/mdesc ]]; then
+if [ "${arch#sparc}" != "$arch" ] && [ -e "${root}/dev/mdesc" ]; then
echo ldoms
- if [[ -d ${root}/sys/class/vlds/ctrl && \
- -d ${root}/sys/class/vlds/sp ]]; then
+ if [ -d "${root}/sys/class/vlds/ctrl" ] && \
+ [ -d "${root}/sys/class/vlds/sp" ]; then
echo ldoms-control
else
echo ldoms-guest
fi
MDPROP="${root}/usr/lib/ldoms/mdprop.py"
- if [[ -x ${MDPROP} ]]; then
- if [[ -n $($MDPROP -v iodevice device-type=pciex) ]]; then
+ if [ -x "${MDPROP}" ]; then
+ if [ -n "$($MDPROP -v iodevice device-type=pciex)" ]; then
echo ldoms-root
echo ldoms-io
- elif [[ -n $($MDPROP -v iov-device vf-id=0) ]]; then
+ elif [ -n "$($MDPROP -v iov-device vf-id=0)" ]; then
echo ldoms-io
fi
fi
--
2.13.2

View File

@ -0,0 +1,35 @@
From a821dc9961d457c086fffcc16a911cb6f9f8659a Mon Sep 17 00:00:00 2001
From: xiliang <xiliang@redhat.com>
Date: Sun, 18 Jun 2017 00:33:28 +0800
Subject: [PATCH 3/3] As xen pv guest can access cpuid from Intel CPUs started
IvyBridge onwards have CPUID Faulting, added one more check in virt-what.
---
virt-what.in | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/virt-what.in b/virt-what.in
index a05e0db..247348e 100644
--- a/virt-what.in
+++ b/virt-what.in
@@ -1,6 +1,6 @@
#!/bin/sh -
# @configure_input@
-# Copyright (C) 2008-2015 Red Hat Inc.
+# Copyright (C) 2008-2017 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
@@ -223,7 +223,8 @@ fi
# Check for Xen.
-if [ "$cpuid" = "XenVMMXenVMM" ]; then
+if [ "$cpuid" = "XenVMMXenVMM" ] &&
+ ! echo "$dmi" | grep -q 'No SMBIOS nor DMI entry point found, sorry'; then
echo xen; echo xen-hvm
# Check for AWS
if echo "$dmi" | grep -q 'Version: [0-9]\.[0-9]\.amazon'; then
--
2.13.2

View File

@ -1,12 +1,17 @@
Name: virt-what Name: virt-what
Version: 1.18 Version: 1.18
Release: 1%{?dist} Release: 2%{?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+
URL: http://people.redhat.com/~rjones/virt-what/ URL: http://people.redhat.com/~rjones/virt-what/
Source0: http://people.redhat.com/~rjones/virt-what/files/%{name}-%{version}.tar.gz Source0: http://people.redhat.com/~rjones/virt-what/files/%{name}-%{version}.tar.gz
# Patches from upstream since 1.18 was released.
Patch0001: 0001-Missing-have_cpuinfo-check.patch
Patch0002: 0002-Remove-bashisms.patch
Patch0003: 0003-As-xen-pv-guest-can-access-cpuid-from-Intel-CPUs-sta.patch
# This is provided by the build root, but we make it explicit # This is provided by the build root, but we make it explicit
# anyway in case this was dropped from the build root in future. # anyway in case this was dropped from the build root in future.
BuildRequires: /usr/bin/pod2man BuildRequires: /usr/bin/pod2man
@ -75,7 +80,7 @@ Current types of virtualization detected:
%prep %prep
%setup -q %autosetup -q
%build %build
@ -101,6 +106,9 @@ fi
%changelog %changelog
* Tue Oct 17 2017 Richard W.M. Jones <rjones@redhat.com> - 1.18-2
- Include upstream patches since 1.18 was released.
* Mon Jul 31 2017 Richard W.M. Jones <rjones@redhat.com> - 1.18-1 * Mon Jul 31 2017 Richard W.M. Jones <rjones@redhat.com> - 1.18-1
- New upstream version 1.18. - New upstream version 1.18.
- Update RPM description section with complete list of supported guests. - Update RPM description section with complete list of supported guests.