[systemd-commits] 2 commits - TODO man/systemd-detect-virt.xml man/systemd.unit.xml src/shared
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Jul 16 05:30:36 PDT 2013
TODO | 4 +++-
man/systemd-detect-virt.xml | 1 +
man/systemd.unit.xml | 1 +
src/shared/virt.c | 11 +++++++++++
4 files changed, 16 insertions(+), 1 deletion(-)
New commits:
commit 7080ea16b5a0bfd71bfcdffc998e91f5273d47f9
Author: Ramkumar Ramachandra <artagnon at gmail.com>
Date: Tue Jul 16 16:44:40 2013 +0530
detect-virt: detect User-Mode Linux
In a User-Mode Linux session:
$ systemd-detect-virt
none
Although it is possible to reliably detect virtualization:
$ cat /proc/cpuinfo
processor : 0
vendor_id : User Mode Linux
model name : UML
mode : skas
host : Linux kytes 3.11.0-rc1-00009-ge5fd680 (...)
bogomips : 7007.43
So, grep for the string "\nvendor_id\t: User Mode Linux\n" in
/proc/cpuinfo, and say "uml" when asked.
diff --git a/man/systemd-detect-virt.xml b/man/systemd-detect-virt.xml
index 762b6ab..f21493df 100644
--- a/man/systemd-detect-virt.xml
+++ b/man/systemd-detect-virt.xml
@@ -70,6 +70,7 @@
<varname>microsoft</varname>,
<varname>oracle</varname>, <varname>xen</varname>,
<varname>bochs</varname>, <varname>chroot</varname>,
+ <varname>uml</varname>,
<varname>openvz</varname>, <varname>lxc</varname>,
<varname>lxc-libvirt</varname>,
<varname>systemd-nspawn</varname>.</para>
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index a14e452..f45632a 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -969,6 +969,7 @@
<varname>xen</varname>,
<varname>bochs</varname>,
<varname>chroot</varname>,
+ <varname>uml</varname>,
<varname>openvz</varname>,
<varname>lxc</varname>,
<varname>lxc-libvirt</varname>,
diff --git a/src/shared/virt.c b/src/shared/virt.c
index 1c86a3d..1abd686 100644
--- a/src/shared/virt.c
+++ b/src/shared/virt.c
@@ -67,6 +67,7 @@ int detect_vm(const char **id) {
const char *j, *k;
bool hypervisor;
_cleanup_free_ char *hvtype = NULL;
+ _cleanup_free_ char *cpuinfo_contents = NULL;
int r;
/* Try high-level hypervisor sysfs file first:
@@ -164,6 +165,16 @@ int detect_vm(const char **id) {
}
#endif
+
+ /* Detect User-Mode Linux by reading /proc/cpuinfo */
+ r = read_full_file("/proc/cpuinfo", &cpuinfo_contents, NULL);
+ if (r < 0)
+ return r;
+ if (strstr(cpuinfo_contents, "\nvendor_id\t: User Mode Linux\n")) {
+ *id = "uml";
+ return 1;
+ }
+
return 0;
}
commit 36c0868b67a9387d39c97983d3d22cfce0fedc62
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Jul 16 14:27:20 2013 +0200
Update TODO
diff --git a/TODO b/TODO
index 3621ce3..735f1a7 100644
--- a/TODO
+++ b/TODO
@@ -56,7 +56,9 @@ CGroup Rework Completion:
Features:
-* when parsing calendar timestamps support the UTC timezone (even if we won't support arbitrary timezone specs, support UTC itself certainly makes sense)
+* when parsing calendar timestamps support the UTC timezone (even if we won't support arbitrary timezone specs, support UTC itself certainly makes sense), also support syntaxes such as +0200
+
+* journalctl: add an output mode that looks like classic /var/log/messages, but also outputs the cursor of the last entry so that people can write scripts that can run iteratively and always process data that has been added since the last time.
* when a kernel driver logs in a tight loop we should ratelimit that too.
More information about the systemd-commits
mailing list