valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

Blame SOURCES/0142-ARM-detect-virt-detect-Xen.patch

803fb7
From 6378069c62b2e5b1005df6bd243709181c178d1c Mon Sep 17 00:00:00 2001
803fb7
From: Andrew Jones <drjones@redhat.com>
803fb7
Date: Tue, 31 Mar 2015 11:08:12 +0200
803fb7
Subject: [PATCH] ARM: detect-virt: detect Xen
803fb7
803fb7
Cherry-picked from: db6a86897efb3
803fb7
Resolves: #1207773
803fb7
---
803fb7
 src/shared/virt.c | 5 ++++-
803fb7
 1 file changed, 4 insertions(+), 1 deletion(-)
803fb7
803fb7
diff --git a/src/shared/virt.c b/src/shared/virt.c
803fb7
index aa3501f42..712523210 100644
803fb7
--- a/src/shared/virt.c
803fb7
+++ b/src/shared/virt.c
803fb7
@@ -102,7 +102,7 @@ static int detect_vm_cpuid(const char **_id) {
803fb7
 }
803fb7
 
803fb7
 static int detect_vm_devicetree(const char **_id) {
803fb7
-#if defined(__powerpc__) || defined(__powerpc64__)
803fb7
+#if defined(__arm__) || defined(__aarch64__) || defined(__powerpc__) || defined(__powerpc64__)
803fb7
         _cleanup_free_ char *hvtype = NULL;
803fb7
         int r;
803fb7
 
803fb7
@@ -111,6 +111,9 @@ static int detect_vm_devicetree(const char **_id) {
803fb7
                 if (streq(hvtype, "linux,kvm")) {
803fb7
                         *_id = "kvm";
803fb7
                         return 1;
803fb7
+                } else if (strstr(hvtype, "xen")) {
803fb7
+                        *_id = "xen";
803fb7
+                        return 1;
803fb7
                 }
803fb7
         }
803fb7
 #endif