1. Why is dmidecode not setuid? If it were, running virt-what as non-root would be a non-issue.
--
2. Why the possibility of outputting multiple lines. Programming laziness? Or do programs now rely on this as a feature? I propose replacing all instances of "echo" with something like "report" where report is a function call:
report() { echo "$*" ; exit 0; }
3. Proposed patches to acknowledge RedHat Virtualization.
The relevant code is taken from facter v2.4.6, files /usr/share/ruby/vendor_ruby/facter/virtual.rb:134 and /usr/share/ruby/vendor_ruby/facter/virtual.rb:175 except that the latter also matches for xen and must be improved here:
diff --git a/virt-what.in b/virt-what.in
index 776bfde..67bbc67 100644
--- a/virt-what.in
+++ b/virt-what.in
@@ -114,6 +114,13 @@ elif echo "$dmi" | grep -q 'Manufacturer: VMware'; then
echo vmware
fi
+# Check for RedHat Virtualization
+if grep -q 'RHEV Hypervisor' "${root}/sys/devices/virtual/dmi/id/product_name"; then
+ echo rhev; exit;
+elif echo "$dmi" | grep -q '[[:space:]]Product Name: RHEV Hypervisor'; then
+ echo rhev; exit;
+fi 2>/dev/null
+
# Check for Hyper-V.
if [ "$cpuid" = "Microsoft Hv" ]; then
I also wrote the test cases. That's in the next mail.
_______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list