[PATCH 4/4] tools: virt-host-validate: HW virt support on s390

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

 



Extend the detection of hardware virtualization to the s390 platform.

Signed-off-by: Bjoern Walk <bwalk@xxxxxxxxxxxxxxxxxx>
---
 tools/virt-host-validate-common.c |  3 ++-
 tools/virt-host-validate-common.h |  1 +
 tools/virt-host-validate-qemu.c   | 21 +++++++++++++++++++--
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c
index 3c19249..4bfc52a 100644
--- a/tools/virt-host-validate-common.c
+++ b/tools/virt-host-validate-common.c
@@ -40,7 +40,8 @@
 
 VIR_ENUM_IMPL(virHostValidateCPUFlag, VIR_HOST_VALIDATE_CPU_FLAG_LAST,
               "vmx",
-              "svm");
+              "svm",
+              "sie");
 
 static bool quiet;
 
diff --git a/tools/virt-host-validate-common.h b/tools/virt-host-validate-common.h
index 26e006b..c14e922 100644
--- a/tools/virt-host-validate-common.h
+++ b/tools/virt-host-validate-common.h
@@ -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;
diff --git a/tools/virt-host-validate-qemu.c b/tools/virt-host-validate-qemu.c
index 47f2f98..56ec3c7 100644
--- a/tools/virt-host-validate-qemu.c
+++ b/tools/virt-host-validate-qemu.c
@@ -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,
-- 
2.6.6

--
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]