<div dir="ltr"><div class="gmail_quote"><div class="gmail_quote">new case: support "rhev" virtualization by RedHat (ovirt based, but branded). Test cases included and passed.</div>---<br>
tests/rhev/proc/cpuinfo | 25 +++++<br>
tests/rhev/sbin/dmidecode | 114 ++++++++++++++++++++<br>
tests/rhev/sbin/uname | 2 +<br>
tests/rhev/sbin/virt-what-cpuid-helper | 2 +<br>
tests/rhev/sys/devices/virtual/dmi/id/product_name | 1 +<br>
tests/test-rhev.sh | 21 ++++<br>
<a href="http://virt-what.in" rel="noreferrer" target="_blank">virt-what.in</a> | 7 ++<br>
7 files changed, 172 insertions(+), 0 deletions(-)<br>
create mode 100644 tests/rhev/proc/cpuinfo<br>
create mode 100644 tests/rhev/proc/self/status<br>
create mode 100755 tests/rhev/sbin/dmidecode<br>
create mode 100755 tests/rhev/sbin/uname<br>
create mode 100755 tests/rhev/sbin/virt-what-cpuid-helper<br>
create mode 100644 tests/rhev/sys/devices/virtual/dmi/id/product_name<br>
create mode 100755 tests/test-rhev.sh<br>
<br>
diff --git a/tests/rhev/proc/cpuinfo b/tests/rhev/proc/cpuinfo<br>
new file mode 100644<br>
index 0000000..a36c629<br>
--- /dev/null<br>
+++ b/tests/rhev/proc/cpuinfo<br>
@@ -0,0 +1,25 @@<br>
+processor : 0<br>
+vendor_id : GenuineIntel<br>
+cpu family : 6<br>
+model : 42<br>
+model name : Intel Xeon E312xx (Sandy Bridge)<br>
+stepping : 1<br>
+microcode : 0x1<br>
+cpu MHz : 2599.998<br>
+cache size : 4096 KB<br>
+physical id : 2<br>
+siblings : 1<br>
+core id : 0<br>
+cpu cores : 1<br>
+apicid : 2<br>
+initial apicid : 2<br>
+fpu : yes<br>
+fpu_exception : yes<br>
+cpuid level : 13<br>
+wp : yes<br>
+flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm xsaveopt<br>
+bogomips : 5199.99<br>
+clflush size : 64<br>
+cache_alignment : 64<br>
+address sizes : 46 bits physical, 48 bits virtual<br>
+power management:<br>
diff --git a/tests/rhev/proc/self/status b/tests/rhev/proc/self/status<br>
new file mode 100644<br>
index 0000000..e69de29<br>
diff --git a/tests/rhev/sbin/dmidecode b/tests/rhev/sbin/dmidecode<br>
new file mode 100755<br>
index 0000000..851562e<br>
--- /dev/null<br>
+++ b/tests/rhev/sbin/dmidecode<br>
@@ -0,0 +1,114 @@<br>
+#!/bin/sh -<br>
+cat <<'EOF'<br>
+# dmidecode 2.11<br>
+SMBIOS 2.4 present.<br>
+25 structures occupying 1035 bytes.<br>
+Table at 0x7E7FFBF0.<br>
+<br>
+Handle 0x0000, DMI type 0, 24 bytes<br>
+BIOS Information<br>
+ Vendor: Seabios<br>
+ Version: 0.5.1<br>
+ Release Date: 01/01/2011<br>
+ Address: 0xE8000<br>
+ Runtime Size: 96 kB<br>
+ ROM Size: 64 kB<br>
+ Characteristics:<br>
+ BIOS characteristics not supported<br>
+ Targeted content distribution is supported<br>
+ BIOS Revision: 1.0<br>
+<br>
+Handle 0x0100, DMI type 1, 27 bytes<br>
+System Information<br>
+ Manufacturer: Red Hat<br>
+ Product Name: RHEV Hypervisor<br>
+ Version: 7.2-20151129.1.el7ev<br>
+ Serial Number: 30313436-3631-5A43-3333-33374E33454B<br>
+ UUID: 0B4DFC1D-7159-46C8-B41D-FC61B85B5952<br>
+ Wake-up Type: Power Switch<br>
+ SKU Number: Not Specified<br>
+ Family: Red Hat Enterprise Linux<br>
+<br>
+Handle 0x0300, DMI type 3, 20 bytes<br>
+Chassis Information<br>
+ Manufacturer: Bochs<br>
+ Type: Other<br>
+ Lock: Not Present<br>
+ Version: Not Specified<br>
+ Serial Number: Not Specified<br>
+ Asset Tag: Not Specified<br>
+ Boot-up State: Safe<br>
+ Power Supply State: Safe<br>
+ Thermal State: Safe<br>
+ Security Status: Unknown<br>
+ OEM Information: 0x00000000<br>
+ Height: Unspecified<br>
+ Number Of Power Cords: Unspecified<br>
+<br>
+Handle 0x0401, DMI type 4, 32 bytes<br>
+Processor Information<br>
+ Socket Designation: CPU 1<br>
+ Type: Central Processor<br>
+ Family: Other<br>
+ Manufacturer: Bochs<br>
+ ID: A1 06 02 00 FD FB 8B 07<br>
+ Version: Not Specified<br>
+ Voltage: Unknown<br>
+ External Clock: Unknown<br>
+ Max Speed: 2000 MHz<br>
+ Current Speed: 2000 MHz<br>
+ Status: Populated, Enabled<br>
+ Upgrade: Other<br>
+ L1 Cache Handle: Not Provided<br>
+ L2 Cache Handle: Not Provided<br>
+ L3 Cache Handle: Not Provided<br>
+<br>
+Handle 0x1000, DMI type 16, 15 bytes<br>
+Physical Memory Array<br>
+ Location: Other<br>
+ Use: System Memory<br>
+ Error Correction Type: Multi-bit ECC<br>
+ Maximum Capacity: 2024 MB<br>
+ Error Information Handle: Not Provided<br>
+ Number Of Devices: 1<br>
+<br>
+Handle 0x1100, DMI type 17, 21 bytes<br>
+Memory Device<br>
+ Array Handle: 0x1000<br>
+ Error Information Handle: 0x0000<br>
+ Total Width: 64 bits<br>
+ Data Width: 64 bits<br>
+ Size: 2024 MB<br>
+ Form Factor: DIMM<br>
+ Set: None<br>
+ Locator: DIMM 0<br>
+ Bank Locator: Not Specified<br>
+ Type: RAM<br>
+ Type Detail: None<br>
+<br>
+Handle 0x1300, DMI type 19, 15 bytes<br>
+Memory Array Mapped Address<br>
+ Starting Address: 0x00000000000<br>
+ Ending Address: 0x0007E7FFFFF<br>
+ Range Size: 2024 MB<br>
+ Physical Array Handle: 0x1000<br>
+ Partition Width: 1<br>
+<br>
+Handle 0x1400, DMI type 20, 19 bytes<br>
+Memory Device Mapped Address<br>
+ Starting Address: 0x00000000000<br>
+ Ending Address: 0x0007E7FFFFF<br>
+ Range Size: 2024 MB<br>
+ Physical Device Handle: 0x1100<br>
+ Memory Array Mapped Address Handle: 0x1300<br>
+ Partition Row Position: 1<br>
+<br>
+Handle 0x2000, DMI type 32, 11 bytes<br>
+System Boot Information<br>
+ Status: No errors detected<br>
+<br>
+Handle 0x7F00, DMI type 127, 4 bytes<br>
+End Of Table<br>
+<br>
+# dmidecode 2.11<br>
+EOF<br>
diff --git a/tests/rhev/sbin/uname b/tests/rhev/sbin/uname<br>
new file mode 100755<br>
index 0000000..ab0ec89<br>
--- /dev/null<br>
+++ b/tests/rhev/sbin/uname<br>
@@ -0,0 +1,2 @@<br>
+#!/bin/sh -<br>
+echo x86_64<br>
diff --git a/tests/rhev/sbin/virt-what-cpuid-helper b/tests/rhev/sbin/virt-what-cpuid-helper<br>
new file mode 100755<br>
index 0000000..4209d83<br>
--- /dev/null<br>
+++ b/tests/rhev/sbin/virt-what-cpuid-helper<br>
@@ -0,0 +1,2 @@<br>
+:<br>
+echo KVMKVMKVM<br>
diff --git a/tests/rhev/sys/devices/virtual/dmi/id/product_name b/tests/rhev/sys/devices/virtual/dmi/id/product_name<br>
new file mode 100644<br>
index 0000000..b6e5ab5<br>
--- /dev/null<br>
+++ b/tests/rhev/sys/devices/virtual/dmi/id/product_name<br>
@@ -0,0 +1 @@<br>
+RHEV Hypervisor<br>
diff --git a/tests/test-rhev.sh b/tests/test-rhev.sh<br>
new file mode 100755<br>
index 0000000..77b5541<br>
--- /dev/null<br>
+++ b/tests/test-rhev.sh<br>
@@ -0,0 +1,21 @@<br>
+# Test for RHEV<br>
+# Author: otheus <<a href="mailto:otheus.uibk@gmail.com">otheus.uibk@gmail.com</a>><br>
+# License: Public domain<br>
+<br>
+root=tests/rhev<br>
+<br>
+output="$(./virt-what --test-root=$root 2>&1)"<br>
+expected="rhev"<br>
+<br>
+if [ "$output" != "$expected" ]; then<br>
+ echo "$0: test failed because output did not match expected"<br>
+ echo "Expected output was:"<br>
+ echo "----------------------------------------"<br>
+ echo "$expected"<br>
+ echo "----------------------------------------"<br>
+ echo "But the actual output of the program was:"<br>
+ echo "----------------------------------------"<br>
+ echo "$output"<br>
+ echo "----------------------------------------"<br>
+ exit 1<br>
+fi<br>
diff --git a/<a href="http://virt-what.in" rel="noreferrer" target="_blank">virt-what.in</a> b/<a href="http://virt-what.in" rel="noreferrer" target="_blank">virt-what.in</a><br>
index 776bfde..67bbc67 100644<br>
--- a/<a href="http://virt-what.in" rel="noreferrer" target="_blank">virt-what.in</a><br>
+++ b/<a href="http://virt-what.in" rel="noreferrer" target="_blank">virt-what.in</a><br>
@@ -114,6 +114,13 @@ elif echo "$dmi" | grep -q 'Manufacturer: VMware'; then<br>
echo vmware<br>
fi<br>
<br>
+# Check for RedHat Virtualization<br>
+if grep -q 'RHEV Hypervisor' "${root}/sys/devices/virtual/dmi/id/product_name"; then<br>
+ echo rhev; exit;<br>
+elif echo "$dmi" | grep -q '[[:space:]]Product Name: RHEV Hypervisor'; then<br>
+ echo rhev; exit;<br>
+fi 2>/dev/null<br>
+<br>
# Check for Hyper-V.<br>
# <a href="http://blogs.msdn.com/b/sqlosteam/archive/2010/10/30/is-this-real-the-metaphysics-of-hardware-virtualization.aspx" rel="noreferrer" target="_blank">http://blogs.msdn.com/b/sqlosteam/archive/2010/10/30/is-this-real-the-metaphysics-of-hardware-virtualization.aspx</a><br>
if [ "$cpuid" = "Microsoft Hv" ]; then<br>
<span class=""><font color="#888888">--<br>
1.7.1<br>
<br>
</font></span></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Otheus<div><a href="mailto:otheus.uibk@gmail.com" target="_blank">otheus.uibk@gmail.com</a></div><div><a href="mailto:otheus.shelling@uibk.ac.at" target="_blank">otheus.shelling@uibk.ac.at</a></div><div><br></div></div></div>
</div>