[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] tools: virt-host-validate: fix KVM check on s390

On 03/21/2016 07:55 AM, Bjoern Walk wrote:
> Since kernel version 4.5, s390 has the 'sie' flag to declare its
> hardware virtualization support. Let's make virt-host-validate aware so
> this check is passed correctly.
> Signed-off-by: Bjoern Walk <bwalk linux vnet ibm com>
> Reviewed-by: Boris Fiuczynski <fiuczy linux vnet ibm com>
> ---
>  tools/virt-host-validate-qemu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

I've never seen the output of /proc/cpuinfo on an S390, but looking at
the source code I found it does seem to print with the "features" for a
cpuinfo on an s390 machine (as opposed the "flags" for a vmx/svm machine).

The virHostValidateHasCPUFlag doesn't really distinguish "flags" or
"features" field being specified as a label (although I imagine that
could have internationalization impact if we tried to limit that more).

Anyway, before I push this - I wanted to see if there were any "other"
thoughts regarding letting this be a bit more generic. My one concern is
some field name some day has "sie" added (e.g. "easier" or "transient"
would match).

One change that may help with that would be to check "sie " instead of
"sie" (similarly "svm" could be "svm " and "vmx" could be "vmx ").  The
source code prints the output as "..."%s ", int_hwcap_str[i]..."


> diff --git a/tools/virt-host-validate-qemu.c b/tools/virt-host-validate-qemu.c
> index a9f6c1e..01fb24b 100644
> --- a/tools/virt-host-validate-qemu.c
> +++ b/tools/virt-host-validate-qemu.c
> @@ -31,7 +31,8 @@ int virHostValidateQEMU(void)
>      virHostMsgCheck("QEMU", "%s", ("for hardware virtualization"));
>      if (virHostValidateHasCPUFlag("svm") ||
> -        virHostValidateHasCPUFlag("vmx")) {
> +        virHostValidateHasCPUFlag("vmx") ||
> +        virHostValidateHasCPUFlag("sie")) {
>          virHostMsgPass();
>          if (virHostValidateDeviceExists("QEMU", "/dev/kvm",
>                                          VIR_HOST_VALIDATE_FAIL,

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]