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

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

 



On Tue, 2016-03-29 at 14:01 +0100, Daniel P. Berrange wrote:
> > >      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,
> 
> What we should do here though is check the host architecture before
> checking CPU flags.
> 
> eg you'll want to make this code do something like this
> 
>        bool hasHWVirt = false;
>        switch (virArchFromHost()) {
>            case VIR_ARCH_I686:
>            case VIR_ARCH_X86_64:
>              if (virHostValidateHasCPUFlag("svm") ||
>                  virHostValidateHasCPUFlag("vmx"))
>        hasHWVirt = true;
>              break;
>            case VIR_ARCH_S390:
>            case VIR_ARCH_S390X:
>              if (virHostValidateHasCPUFlag("sie"))
>            hasHWVirt = true;
>        }
>        if (hasHWVirt) {
>        ....do the /dev/kvm check...
>        }

... And I guess I should come up with suitable checks for
ppc64 and aarch64 as well :)

Cheers.

-- 
Andrea Bolognani
Software Engineer - Virtualization Team

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]