forked from pool/systemd
74b2bf3650
- Extend avoid-divide-by-zero-sigtrap.patch to make the crash handler know about SIGTRAP and SIGSYS - Add avoid-divide-by-zero-sigtrap.patch which fixes bnc#867663 that is a divide by zero on a jobless system - Use latest regenerate-initrd rpm macros (fate#313506) - Add rescue-emergency-target-conflicts.patch to avoid that emergency and rescue sulogin are fighting on console - Modify systemd-sleep-grub to let hybrid-sleep.target work even on XEN, changes from Thomas Blume (bnc#873432) - Add backported upstream patch 0001-reduce-the-amount-of-messages-logged-to-dev-kmsg-whe.patch - Add patch systemd-detect-xendom.patch from Thomas Blume to be able to detect XEN dom0 as well as domU - systemd conflicts with sysvinit, ven if the package systemd-sysvinit does already conflict with sysvinit-init (bnc#873444) - Extend avoid-divide-by-zero-sigtrap.patch to make the crash handler know about SIGTRAP and SIGSYS - Add avoid-divide-by-zero-sigtrap.patch which fixes bnc#867663 that is a divide by zero on a jobless system - Use latest regenerate-initrd rpm macros (fate#313506) - Add rescue-emergency-target-conflicts.patch to avoid that emergency and rescue sulogin are fighting on console OBS-URL: https://build.opensuse.org/request/show/230483 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=182
36 lines
1.4 KiB
Diff
36 lines
1.4 KiB
Diff
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/src/shared/virt.c 2014-04-10 13:48:05.568766957 +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 *domcap = NULL, *cpuinfo_contents = NULL;
|
|
static thread_local int cached_found = -1;
|
|
static thread_local const char *cached_id = NULL;
|
|
const char *_id = NULL;
|
|
@@ -166,13 +166,18 @@
|
|
/* Try high-level hypervisor sysfs file first:
|
|
*
|
|
* https://bugs.freedesktop.org/show_bug.cgi?id=61491 */
|
|
- r = read_one_line_file("/sys/hypervisor/type", &hvtype);
|
|
+ r = read_one_line_file("/proc/xen/capabilities", &domcap);
|
|
if (r >= 0) {
|
|
- if (streq(hvtype, "xen")) {
|
|
- _id = "xen";
|
|
+ if (strstr(domcap, "control_d")) {
|
|
+ r = 0;
|
|
+ _id = "xen-dom0";
|
|
+ } else {
|
|
r = 1;
|
|
- goto finish;
|
|
+ _id = "xen-domU";
|
|
}
|
|
+
|
|
+ goto finish;
|
|
+
|
|
} else if (r != -ENOENT)
|
|
return r;
|
|
|