[virt-tools-list] (no subject)

Richard W.M. Jones rjones at redhat.com
Thu Mar 24 08:58:31 UTC 2016

On Wed, Mar 23, 2016 at 02:12:20PM +0100, otheus uibk wrote:
> 1. Why is dmidecode not setuid?  If it were, running virt-what as non-root
> would be a non-issue.

Actually you can now read dmidecode data from /sys/firmware/dmi, and
we should use that instead.  However that wasn't a kernel feature when
I originally wrote virt-what.

> 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; }

virt-what really should be able to output multiple lines.  There are
many cases where multiple facts apply to a single guest.

In any case we cannot change what we output now, since other programs
rely on that interface.

> 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.
>  #
> http://blogs.msdn.com/b/sqlosteam/archive/2010/10/30/is-this-real-the-metaphysics-of-hardware-virtuali
>  if [ "$cpuid" = "Microsoft Hv" ]; then
> I also wrote the test cases. That's in the next mail.

I'll take a look, thanks.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.

More information about the virt-tools-list mailing list