Re: [PATCH 0/5] lscpu: improve hypervisor detection

Karel Zak
2014-05-21T08:24:45Z

On Tue, May 20, 2014 at 06:34:22PM +0200, Stanislav Brabec wrote:
> Ruediger Meierwrote:
>
> > I've splitted the original patch into smaller pieces, removed some
> > incompatible output format changes and added some test data.
>
> There was a controversial part of this patch, that causes test failure.
>
> There should be a way how to output result of the virtual machine
> detection without breaking test cases (and possibly existing scripts).

Like many other utils we have a way how to specify output columns

lscpu --extended[= ]
lscpu --parse[= ]

The man page:

-p, --parse[=list]

If the list argument is omitted, the command output is compatible
with earlier versions of lscpu.

it means that HvVendor,VirtType have to be omitted from -p by default.

Frankly, I don't see any practical reason to have hypervisor info in -p
and -e at all. These output formats are about CPU topology and per-CPU
specific information. The global stuff makes more sense for the default
(without options) output where you can use

lscpu | awk '/Hypervisor type/ { print $2 }'

or so...

Karel

--
Karel Zak <kzak@redhat.com>