mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
tools: virt-host-validate: HW virt support on s390
Extend the detection of hardware virtualization to the s390 platform. Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
This commit is contained in:
parent
efc23df251
commit
71714e8549
@ -40,7 +40,8 @@
|
||||
|
||||
VIR_ENUM_IMPL(virHostValidateCPUFlag, VIR_HOST_VALIDATE_CPU_FLAG_LAST,
|
||||
"vmx",
|
||||
"svm");
|
||||
"svm",
|
||||
"sie");
|
||||
|
||||
static bool quiet;
|
||||
|
||||
|
@ -37,6 +37,7 @@ typedef enum {
|
||||
typedef enum {
|
||||
VIR_HOST_VALIDATE_CPU_FLAG_VMX = 0,
|
||||
VIR_HOST_VALIDATE_CPU_FLAG_SVM,
|
||||
VIR_HOST_VALIDATE_CPU_FLAG_SIE,
|
||||
|
||||
VIR_HOST_VALIDATE_CPU_FLAG_LAST,
|
||||
} virHostValidateCPUFlag;
|
||||
|
@ -24,20 +24,37 @@
|
||||
|
||||
#include "virt-host-validate-qemu.h"
|
||||
#include "virt-host-validate-common.h"
|
||||
#include "virarch.h"
|
||||
#include "virbitmap.h"
|
||||
|
||||
int virHostValidateQEMU(void)
|
||||
{
|
||||
virBitmapPtr flags;
|
||||
int ret = 0;
|
||||
bool hasHwVirt = false;
|
||||
|
||||
virHostMsgCheck("QEMU", "%s", _("for hardware virtualization"));
|
||||
|
||||
if (!(flags = virHostValidateGetCPUFlags()))
|
||||
return -1;
|
||||
|
||||
if ((virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SVM) ||
|
||||
virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_VMX))) {
|
||||
switch (virArchFromHost()) {
|
||||
case VIR_ARCH_I686:
|
||||
case VIR_ARCH_X86_64:
|
||||
if (virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SVM) ||
|
||||
virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_VMX))
|
||||
hasHwVirt = true;
|
||||
break;
|
||||
case VIR_ARCH_S390:
|
||||
case VIR_ARCH_S390X:
|
||||
if (virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_SIE))
|
||||
hasHwVirt = true;
|
||||
break;
|
||||
default:
|
||||
hasHwVirt = false;
|
||||
}
|
||||
|
||||
if (hasHwVirt) {
|
||||
virHostMsgPass();
|
||||
if (virHostValidateDeviceExists("QEMU", "/dev/kvm",
|
||||
VIR_HOST_VALIDATE_FAIL,
|
||||
|
Loading…
Reference in New Issue
Block a user