diff -Naur systemd-210/src/shared/virt.c systemd-210-mod/src/shared/virt.c --- systemd-210/src/shared/virt.c 2014-02-24 15:38:03.909784909 +0100 +++ systemd-210-mod/src/shared/virt.c 2014-04-23 10:54:42.764134881 +0200 @@ -149,7 +149,7 @@ /* Returns a short identifier for the various VM implementations */ int detect_vm(const char **id) { - _cleanup_free_ char *hvtype = NULL, *cpuinfo_contents = NULL; + _cleanup_free_ char *hvtype = NULL, *domcap = NULL, *cpuinfo_contents = NULL; static thread_local int cached_found = -1; static thread_local const char *cached_id = NULL; const char *_id = NULL; @@ -169,10 +169,23 @@ r = read_one_line_file("/sys/hypervisor/type", &hvtype); if (r >= 0) { if (streq(hvtype, "xen")) { - _id = "xen"; - r = 1; + r = read_one_line_file("/proc/xen/capabilities", &domcap); + if (r >= 0) { + if (strstr(domcap, "control_d")) { + r = 0; + _id = "xen-dom0"; + } else { + r = 1; + _id = "xen-domU"; + } + } else { + _id = "xen"; + r = 1; + } + goto finish; } + } else if (r != -ENOENT) return r;