From 29882f97e6d3384dd943619c732d40eb7d0dd539 Mon Sep 17 00:00:00 2001 From: Fabian Arrotin Date: Tue, 6 Nov 2012 22:49:33 +0100 Subject: [PATCH] Fixed the way dom0/domU xen role is defined in the setup module --- library/setup | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/library/setup b/library/setup index 24a0985a1be..480964e9c61 100755 --- a/library/setup +++ b/library/setup @@ -711,11 +711,12 @@ class LinuxVirtual(Virtual): def get_virtual_facts(self): if os.path.exists("/proc/xen"): self.facts['virtualization_type'] = 'xen' + self.facts['virtualization_role'] = 'guest' if os.path.exists('/proc/xen/capabilities'): - self.facts['virtualization_role'] = 'host' - else: - self.facts['virtualization_role'] = 'guest' - + for line in open('/proc/xen/capabilities'): + if "control_d" in line: + self.facts['virtualization_role'] = 'host' + elif os.path.exists('/proc/vz'): self.facts['virtualization_type'] = 'openvz' if os.path.exists('/proc/vz/version'):