anitazha / rpms / systemd

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