valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

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

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