summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-25 00:13:05 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-25 00:13:05 +0100
commit7d39db92c5e3d4f0448982639ba06ae442bb6226 (patch)
tree93abaad44f9054f759b9a5e9f62ce0e196ddb7f6
parentcaa94887002de8596c69f578dbdb684dfb368240 (diff)
downloadsystemd-7d39db92c5e3d4f0448982639ba06ae442bb6226.tar.gz
systemd-7d39db92c5e3d4f0448982639ba06ae442bb6226.tar.bz2
systemd-7d39db92c5e3d4f0448982639ba06ae442bb6226.zip
virt: detect LXC+libvirt containers
-rw-r--r--man/systemd.unit.xml1
-rw-r--r--src/virt.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 30559b99f8..eecff7373a 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -779,6 +779,7 @@
<varname>chroot</varname>,
<varname>openvz</varname>,
<varname>lxc</varname>,
+ <varname>lxc-libvirt</varname>,
<varname>systemd-nspawn</varname>,
<varname>pidns</varname> to test
against a specific implementation. If
diff --git a/src/virt.c b/src/virt.c
index 380fabded2..3f0912a8a6 100644
--- a/src/virt.c
+++ b/src/virt.c
@@ -209,6 +209,13 @@ int detect_container(const char **id) {
*id = "lxc";
return 1;
+ } else if (streq(line, "container=lxc-libvirt")) {
+ fclose(f);
+
+ if (id)
+ *id = "lxc-libvirt";
+ return 1;
+
} else if (streq(line, "container=systemd-nspawn")) {
fclose(f);