anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone
Blob Blame History Raw
From 6378069c62b2e5b1005df6bd243709181c178d1c Mon Sep 17 00:00:00 2001
From: Andrew Jones <drjones@redhat.com>
Date: Tue, 31 Mar 2015 11:08:12 +0200
Subject: [PATCH] ARM: detect-virt: detect Xen

Cherry-picked from: db6a86897efb3
Resolves: #1207773
---
 src/shared/virt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/shared/virt.c b/src/shared/virt.c
index aa3501f..7125232 100644
--- a/src/shared/virt.c
+++ b/src/shared/virt.c
@@ -102,7 +102,7 @@ static int detect_vm_cpuid(const char **_id) {
 }
 
 static int detect_vm_devicetree(const char **_id) {
-#if defined(__powerpc__) || defined(__powerpc64__)
+#if defined(__arm__) || defined(__aarch64__) || defined(__powerpc__) || defined(__powerpc64__)
         _cleanup_free_ char *hvtype = NULL;
         int r;
 
@@ -111,6 +111,9 @@ static int detect_vm_devicetree(const char **_id) {
                 if (streq(hvtype, "linux,kvm")) {
                         *_id = "kvm";
                         return 1;
+                } else if (strstr(hvtype, "xen")) {
+                        *_id = "xen";
+                        return 1;
                 }
         }
 #endif