[libvirt] [PATCH] libvirt: move default nwfilters to datadir.
by Dimitri John Ledkov
libvirt runs correctly without any configuration files, as sensible
defaults are used throughout. This commit introduces a layer for
nwfilter configuration. This means that default filters are shipped in
/usr/share/libvirt/nwfilter/ directory, which can be overridden by
things in /etc/libvirt/nwfilter. This is similar to configuration
splits as observed in udev, systemd, XDG Base Directory Specification
and so on. This will make a distinction and make it obvious if any of
the nwfilters are modified by the administrator.
---
examples/xml/nwfilter/Makefile.am | 2 +-
src/conf/nwfilter_conf.h | 1 +
src/nwfilter/nwfilter_driver.c | 18 +++++++++++-------
3 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/examples/xml/nwfilter/Makefile.am b/examples/xml/nwfilter/Makefile.am
index ec1e7ee..61f328a 100644
--- a/examples/xml/nwfilter/Makefile.am
+++ b/examples/xml/nwfilter/Makefile.am
@@ -37,7 +37,7 @@ EXTRA_DIST=$(FILTERS)
confdir = $(sysconfdir)/libvirt
-NWFILTER_DIR = "$(DESTDIR)$(sysconfdir)/libvirt/nwfilter"
+NWFILTER_DIR = "$(DESTDIR)$(datadir)/libvirt/nwfilter"
if WITH_NWFILTER
install-data-local:
diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h
index 6e68ecc..ee427b1 100644
--- a/src/conf/nwfilter_conf.h
+++ b/src/conf/nwfilter_conf.h
@@ -577,6 +577,7 @@ struct _virNWFilterDriverState {
virNWFilterObjList nwfilters;
char *configDir;
+ char *defaultsDir;
bool watchingFirewallD;
};
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index 8e3db43..2e81dbf 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -173,7 +173,6 @@ nwfilterStateInitialize(bool privileged,
virStateInhibitCallback callback ATTRIBUTE_UNUSED,
void *opaque ATTRIBUTE_UNUSED)
{
- char *base = NULL;
DBusConnection *sysbus = NULL;
if (!privileged)
@@ -228,17 +227,20 @@ nwfilterStateInitialize(bool privileged,
goto error;
}
- if (VIR_STRDUP(base, SYSCONFDIR "/libvirt") < 0)
+ if (virAsprintf(&driver->configDir,
+ SYSCONFDIR "/libvirt/nwfilter") == -1)
goto error;
- if (virAsprintf(&driver->configDir,
- "%s/nwfilter", base) == -1)
+ if (virNWFilterLoadAllConfigs(&driver->nwfilters,
+ driver->configDir) < 0)
goto error;
- VIR_FREE(base);
+ if (virAsprintf(&driver->defaultsDir,
+ PKGDATADIR "/nwfilter") == -1)
+ goto error;
if (virNWFilterLoadAllConfigs(&driver->nwfilters,
- driver->configDir) < 0)
+ driver->defaultsDir) < 0)
goto error;
nwfilterDriverUnlock();
@@ -246,7 +248,6 @@ nwfilterStateInitialize(bool privileged,
return 0;
error:
- VIR_FREE(base);
nwfilterDriverUnlock();
nwfilterStateCleanup();
@@ -292,6 +293,8 @@ nwfilterStateReload(void)
virNWFilterLoadAllConfigs(&driver->nwfilters,
driver->configDir);
+ virNWFilterLoadAllConfigs(&driver->nwfilters,
+ driver->defaultsDir);
virNWFilterCallbackDriversUnlock();
virNWFilterUnlockFilterUpdates();
@@ -345,6 +348,7 @@ nwfilterStateCleanup(void)
virNWFilterObjListFree(&driver->nwfilters);
VIR_FREE(driver->configDir);
+ VIR_FREE(driver->defaultsDir);
nwfilterDriverUnlock();
}
--
2.1.0
9 years, 8 months
[libvirt] [PATCH] Use PAUSED state for domains that are starting up
by Jiri Denemark
When libvirt is starting a domain, it reports the state as SHUTOFF until
it's RUNNING. This is not ideal because domain startup may take a long
time (usually because of some configuration issues, firewalls blocking
access to network disks, etc.) and domain lists provided by libvirt look
awkward. One can see weird shutoff domains with IDs in a list of active
domains or even shutoff transient domains. In any case, it looks more
like a bug in libvirt than a normal state a domain goes through.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
After going through all hypervisor drivers it seems none of them needs
to be updated. That is, this patch matches the one I sent as RFC for
design discussions.
include/libvirt/libvirt-domain.h | 1 +
src/conf/domain_conf.c | 3 ++-
src/qemu/qemu_process.c | 22 ++++++++++++++--------
tools/virsh-domain-monitor.c | 3 ++-
4 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 9487b80..d5c148b 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -116,6 +116,7 @@ typedef enum {
VIR_DOMAIN_PAUSED_SHUTTING_DOWN = 8, /* paused during shutdown process */
VIR_DOMAIN_PAUSED_SNAPSHOT = 9, /* paused while creating a snapshot */
VIR_DOMAIN_PAUSED_CRASHED = 10, /* paused due to a guest crash */
+ VIR_DOMAIN_PAUSED_STARTING_UP = 11, /* the domain is being started */
# ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_PAUSED_LAST
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index cc8616b..783c382 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -661,7 +661,8 @@ VIR_ENUM_IMPL(virDomainPausedReason, VIR_DOMAIN_PAUSED_LAST,
"from snapshot",
"shutdown",
"snapshot",
- "panicked")
+ "panicked",
+ "starting up")
VIR_ENUM_IMPL(virDomainShutdownReason, VIR_DOMAIN_SHUTDOWN_LAST,
"unknown",
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d1f089d..649b3df 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3418,6 +3418,7 @@ qemuProcessUpdateState(virQEMUDriverPtr driver, virDomainObjPtr vm)
virDomainState state;
virDomainPausedReason reason;
virDomainState newState = VIR_DOMAIN_NOSTATE;
+ int oldReason;
int newReason;
bool running;
char *msg = NULL;
@@ -3431,9 +3432,16 @@ qemuProcessUpdateState(virQEMUDriverPtr driver, virDomainObjPtr vm)
if (ret < 0)
return -1;
- state = virDomainObjGetState(vm, NULL);
+ state = virDomainObjGetState(vm, &oldReason);
- if (state == VIR_DOMAIN_PAUSED && running) {
+ if (running &&
+ (state == VIR_DOMAIN_SHUTOFF ||
+ (state == VIR_DOMAIN_PAUSED &&
+ oldReason == VIR_DOMAIN_PAUSED_STARTING_UP))) {
+ newState = VIR_DOMAIN_RUNNING;
+ newReason = VIR_DOMAIN_RUNNING_BOOTED;
+ ignore_value(VIR_STRDUP_QUIET(msg, "finished booting"));
+ } else if (state == VIR_DOMAIN_PAUSED && running) {
newState = VIR_DOMAIN_RUNNING;
newReason = VIR_DOMAIN_RUNNING_UNPAUSED;
ignore_value(VIR_STRDUP_QUIET(msg, "was unpaused"));
@@ -3452,10 +3460,6 @@ qemuProcessUpdateState(virQEMUDriverPtr driver, virDomainObjPtr vm)
ignore_value(virAsprintf(&msg, "was paused (%s)",
virDomainPausedReasonTypeToString(reason)));
}
- } else if (state == VIR_DOMAIN_SHUTOFF && running) {
- newState = VIR_DOMAIN_RUNNING;
- newReason = VIR_DOMAIN_RUNNING_BOOTED;
- ignore_value(VIR_STRDUP_QUIET(msg, "finished booting"));
}
if (newState != VIR_DOMAIN_NOSTATE) {
@@ -3828,7 +3832,9 @@ qemuProcessReconnect(void *opaque)
goto error;
state = virDomainObjGetState(obj, &reason);
- if (state == VIR_DOMAIN_SHUTOFF) {
+ if (state == VIR_DOMAIN_SHUTOFF ||
+ (state == VIR_DOMAIN_PAUSED &&
+ reason == VIR_DOMAIN_PAUSED_STARTING_UP)) {
VIR_DEBUG("Domain '%s' wasn't fully started yet, killing it",
obj->def->name);
goto error;
@@ -4459,7 +4465,7 @@ int qemuProcessStart(virConnectPtr conn,
vm->def->id = qemuDriverAllocateID(driver);
qemuDomainSetFakeReboot(driver, vm, false);
- virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTOFF_UNKNOWN);
+ virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_STARTING_UP);
if (virAtomicIntInc(&driver->nactive) == 1 && driver->inhibitCallback)
driver->inhibitCallback(true, driver->inhibitOpaque);
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 464ac11..30ddae4 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -199,7 +199,8 @@ VIR_ENUM_IMPL(vshDomainPausedReason,
N_("from snapshot"),
N_("shutting down"),
N_("creating snapshot"),
- N_("crashed"))
+ N_("crashed"),
+ N_("starting up"))
VIR_ENUM_DECL(vshDomainShutdownReason)
VIR_ENUM_IMPL(vshDomainShutdownReason,
--
2.3.1
9 years, 8 months
[libvirt] [PATCH] update documentation for command cd
by swat
Updated the documentation for command cd
The documentation for command cd did not have information about the command. Added the required information.
---
source/cd.xml | 36 +++++++++++++++++++++++++++++++++---
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/source/cd.xml b/source/cd.xml
index 78a13df..d4afbc9 100644
--- a/source/cd.xml
+++ b/source/cd.xml
@@ -9,16 +9,46 @@
</text>
</description>
- <options />
+ <options>
+ <parameter requirement="optional">
+ <keyword requirement="optional">--dir</keyword>
+ <value type="string" requirement="optional">path</value>
+ <description>
+ <text>
+ directory to switch to (default: home or else root)
+ </text>
+ <text>
+ --dir itself is optional
+ </text>
+ </description>
+ </parameter>
+ </options>
<availability from="0.7.0" />
<notes />
- <examples type="usage" />
+ <examples type="usage" >
+ <example>
+ <terminal>
+virsh # <bold> cd </bold> <value>/tmp</value> </terminal>
+ <text>
+ Changes the current working directory to <value> /tmp </tmp>
+ </text>
+ </example>
+ </examples>
<examples type="fullcontext" />
<reference type="seealso" />
-
+ <item>
+ <link type="internal" href="pwd"/>
+ <name>
+ pwd
+ </name>
+ <description>
+ Displays the current directory
+ </description>
+ </item>
+ </reference>
</command>
--
1.9.1
9 years, 8 months
[libvirt] [test-API][PATCH] Add connection_security_model test case
by lcheng
The connection_security_model.py uses getSecurityModel() to validate new API virNodeGetSecurityModel of libvirt.
---
cases/linux_domain.conf | 4 ++
repos/virconn/connection_security_model.py | 101 +++++++++++++++++++++++++++++
2 files changed, 105 insertions(+)
create mode 100644 repos/virconn/connection_security_model.py
diff --git a/cases/linux_domain.conf b/cases/linux_domain.conf
index 903fdb5..a7015f0 100644
--- a/cases/linux_domain.conf
+++ b/cases/linux_domain.conf
@@ -233,6 +233,10 @@ domain:domain_fsthaw
guestname
$defaultname
+virconn:connection_security_model
+ guestname
+ $defaultname
+
domain:destroy
guestname
$defaultname
diff --git a/repos/virconn/connection_security_model.py b/repos/virconn/connection_security_model.py
new file mode 100644
index 0000000..b44d78c
--- /dev/null
+++ b/repos/virconn/connection_security_model.py
@@ -0,0 +1,101 @@
+#!/usr/bin/env python
+# To test "getSecurityModel"
+
+import libvirt
+
+from xml.dom import minidom
+from libvirt import libvirtError
+from src import sharedmod
+from utils import utils
+
+required_params = ('guestname',)
+optional_params = {}
+
+def get_security_driver(logger):
+ """get security driver from /etc/libvirt/qemu.conf"""
+
+ cmds = "grep \"^security_driver\" /etc/libvirt/qemu.conf"
+ (ret, conf) = utils.exec_cmd(cmds, shell=True)
+ if ret:
+ cmds = "getenforce"
+ (ret, policy) = utils.exec_cmd(cmds, shell=True)
+
+ if policy[0] == "Disabled":
+ return "none"
+ else:
+ return "selinux"
+
+ tmp = conf[0].split(' = ')
+ if len(tmp[1].split(', ')) > 1:
+ driver = tmp[1].split(', ')
+ return (filter(str.isalpha, driver[0]))
+ else:
+ cmds = "echo '%s' | awk -F '\"' '{print $2}'" % conf[0]
+ (ret, driver) = utils.exec_cmd(cmds, shell=True)
+
+ if driver[0] == "selinux":
+ return "selinux"
+ elif driver[0] == "none":
+ return "none"
+ elif driver[0] == "apparmor":
+ return "apparmor"
+ elif driver[0] == "stack":
+ return "stack"
+ else:
+ return ""
+
+def get_security_model(logger, domname):
+ """get security model from process"""
+
+ PID = "ps aux | grep -v grep | grep %s | awk '{print $2}'" % domname
+ ret, pid = utils.exec_cmd(PID, shell=True)
+ if ret:
+ logger.error("get domain pid failed.")
+ return ""
+
+ LABEL = "ls -nZd /proc/%s" % pid[0]
+ ret, label = utils.exec_cmd(LABEL, shell=True)
+ if ret:
+ logger.error("get domain process's label failed.")
+ return ""
+
+ if "system_u:system_r:svirt_t:s0" in label[0]:
+ return "selinux"
+ else:
+ return "none"
+
+def check_security_model(logger, domname, model):
+ """ check security model"""
+
+ dommodel = get_security_model(logger, domname)
+ driver = get_security_driver(logger)
+
+ logger.info("domain security model is %s." % dommodel)
+ logger.info("get security driver is %s." % driver)
+ logger.info("get security model is %s." % model)
+
+ if driver == dommodel and dommodel == model:
+ return True
+ else:
+ return False
+
+def connection_security_model(params):
+ """test API for getSecurityModel"""
+
+ logger = params['logger']
+ domname = params['guestname']
+ conn = sharedmod.libvirtobj['conn']
+
+ try:
+ model = conn.getSecurityModel()
+
+ if not check_security_model(logger, domname, model[0]):
+ logger.error("Fail : get a error security model.")
+ return 1
+ else:
+ logger.info("Pass : get security model successful.")
+ return 0
+ except libvirtError, e:
+ logger.error("API error message: %s" % e.message)
+ return 1
+
--
1.8.3.1
9 years, 8 months
[libvirt] [PATCH] tests: Add tests for virCgroupDetectMounts
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/libvirt_private.syms | 1 +
src/util/vircgroup.c | 19 ++--
src/util/vircgrouppriv.h | 4 +
tests/vircgroupdata/all-in-one.mounts | 7 ++
tests/vircgroupdata/all-in-one.parsed | 10 +++
tests/vircgroupdata/cgroups1.mounts | 30 +++++++
tests/vircgroupdata/cgroups1.parsed | 10 +++
tests/vircgroupdata/cgroups2.mounts | 22 +++++
tests/vircgroupdata/cgroups2.parsed | 10 +++
tests/vircgroupdata/cgroups3.mounts | 28 ++++++
tests/vircgroupdata/cgroups3.parsed | 10 +++
tests/vircgroupdata/fedora-18.mounts | 30 +++++++
tests/vircgroupdata/fedora-18.parsed | 10 +++
tests/vircgroupdata/fedora-21.mounts | 33 +++++++
tests/vircgroupdata/fedora-21.parsed | 10 +++
tests/vircgroupdata/no-cgroups.mounts | 10 +++
tests/vircgroupdata/no-cgroups.parsed | 10 +++
tests/vircgroupdata/ovirt-node-6.6.mounts | 144 ++++++++++++++++++++++++++++++
tests/vircgroupdata/ovirt-node-6.6.parsed | 10 +++
tests/vircgroupdata/ovirt-node-7.1.mounts | 142 +++++++++++++++++++++++++++++
tests/vircgroupdata/ovirt-node-7.1.parsed | 10 +++
tests/vircgroupdata/rhel-7.1.mounts | 31 +++++++
tests/vircgroupdata/rhel-7.1.parsed | 10 +++
tests/vircgrouptest.c | 71 +++++++++++++++
24 files changed, 666 insertions(+), 6 deletions(-)
create mode 100644 tests/vircgroupdata/all-in-one.mounts
create mode 100644 tests/vircgroupdata/all-in-one.parsed
create mode 100644 tests/vircgroupdata/cgroups1.mounts
create mode 100644 tests/vircgroupdata/cgroups1.parsed
create mode 100644 tests/vircgroupdata/cgroups2.mounts
create mode 100644 tests/vircgroupdata/cgroups2.parsed
create mode 100644 tests/vircgroupdata/cgroups3.mounts
create mode 100644 tests/vircgroupdata/cgroups3.parsed
create mode 100644 tests/vircgroupdata/fedora-18.mounts
create mode 100644 tests/vircgroupdata/fedora-18.parsed
create mode 100644 tests/vircgroupdata/fedora-21.mounts
create mode 100644 tests/vircgroupdata/fedora-21.parsed
create mode 100644 tests/vircgroupdata/no-cgroups.mounts
create mode 100644 tests/vircgroupdata/no-cgroups.parsed
create mode 100644 tests/vircgroupdata/ovirt-node-6.6.mounts
create mode 100644 tests/vircgroupdata/ovirt-node-6.6.parsed
create mode 100644 tests/vircgroupdata/ovirt-node-7.1.mounts
create mode 100644 tests/vircgroupdata/ovirt-node-7.1.parsed
create mode 100644 tests/vircgroupdata/rhel-7.1.mounts
create mode 100644 tests/vircgroupdata/rhel-7.1.parsed
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 1fb42ac..ca27af4 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1126,6 +1126,7 @@ virCgroupDenyAllDevices;
virCgroupDenyDevice;
virCgroupDenyDeviceMajor;
virCgroupDenyDevicePath;
+virCgroupDetectMountsFromFile;
virCgroupFree;
virCgroupGetBlkioIoDeviceServiced;
virCgroupGetBlkioIoServiced;
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index e54a079..5c392ac 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -338,18 +338,19 @@ virCgroupCopyMounts(virCgroupPtr group,
* Process /proc/mounts figuring out what controllers are
* mounted and where
*/
-static int
-virCgroupDetectMounts(virCgroupPtr group)
+int
+virCgroupDetectMountsFromFile(virCgroupPtr group,
+ const char *path,
+ bool checkLinks)
{
size_t i;
FILE *mounts = NULL;
struct mntent entry;
char buf[CGROUP_MAX_VAL];
- mounts = fopen("/proc/mounts", "r");
+ mounts = fopen(path, "r");
if (mounts == NULL) {
- virReportSystemError(errno, "%s",
- _("Unable to open /proc/mounts"));
+ virReportSystemError(errno, _("Unable to open %s"), path);
return -1;
}
@@ -394,7 +395,7 @@ virCgroupDetectMounts(virCgroupPtr group)
/* If it is a co-mount it has a filename like "cpu,cpuacct"
* and we must identify the symlink path */
- if (strchr(tmp2 + 1, ',')) {
+ if (checkLinks && strchr(tmp2 + 1, ',')) {
*tmp2 = '\0';
if (virAsprintf(&linksrc, "%s/%s",
entry.mnt_dir, typestr) < 0)
@@ -436,6 +437,12 @@ virCgroupDetectMounts(virCgroupPtr group)
return -1;
}
+static int
+virCgroupDetectMounts(virCgroupPtr group)
+{
+ return virCgroupDetectMountsFromFile(group, "/proc/mounts", true);
+}
+
static int
virCgroupCopyPlacement(virCgroupPtr group,
diff --git a/src/util/vircgrouppriv.h b/src/util/vircgrouppriv.h
index 582be79..722863e 100644
--- a/src/util/vircgrouppriv.h
+++ b/src/util/vircgrouppriv.h
@@ -48,4 +48,8 @@ struct virCgroup {
struct virCgroupController controllers[VIR_CGROUP_CONTROLLER_LAST];
};
+int virCgroupDetectMountsFromFile(virCgroupPtr group,
+ const char *path,
+ bool checkLinks);
+
#endif /* __VIR_CGROUP_PRIV_H__ */
diff --git a/tests/vircgroupdata/all-in-one.mounts b/tests/vircgroupdata/all-in-one.mounts
new file mode 100644
index 0000000..14093b9
--- /dev/null
+++ b/tests/vircgroupdata/all-in-one.mounts
@@ -0,0 +1,7 @@
+rootfs / rootfs rw 0 0
+sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
+proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
+udev /dev devtmpfs rw,relatime,size=16458560k,nr_inodes=4114640,mode=755 0 0
+devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
+nfsd /proc/fs/nfsd nfsd rw,relatime 0 0
+cgroup /sys/fs/cgroup cgroup rw,relatime,blkio,devices,memory,cpuacct,cpu,cpuset 0 0
diff --git a/tests/vircgroupdata/all-in-one.parsed b/tests/vircgroupdata/all-in-one.parsed
new file mode 100644
index 0000000..2701778
--- /dev/null
+++ b/tests/vircgroupdata/all-in-one.parsed
@@ -0,0 +1,10 @@
+cpu /sys/fs/cgroup
+cpuacct /sys/fs/cgroup
+cpuset /sys/fs/cgroup
+memory /sys/fs/cgroup
+devices /sys/fs/cgroup
+freezer <null>
+blkio /sys/fs/cgroup
+net_cls <null>
+perf_event <null>
+name=systemd <null>
diff --git a/tests/vircgroupdata/cgroups1.mounts b/tests/vircgroupdata/cgroups1.mounts
new file mode 100644
index 0000000..881463a
--- /dev/null
+++ b/tests/vircgroupdata/cgroups1.mounts
@@ -0,0 +1,30 @@
+proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
+udev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=1494868,mode=755 0 0
+devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
+sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
+/dev/mapper/root / ext4 rw,noatime,nodiratime,data=ordered 0 0
+tmpfs /run tmpfs rw,nodev,relatime,size=1202892k,mode=755 0 0
+mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
+shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0
+debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
+cgroup_root /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0
+fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
+openrc /sys/fs/cgroup/openrc cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc 0 0
+cpuset /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
+cpu /sys/fs/cgroup/cpu cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0
+cpuacct /sys/fs/cgroup/cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0
+memory /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
+devices /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
+freezer /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
+net_cls /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0
+blkio /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
+net_prio /sys/fs/cgroup/net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_prio 0 0
+hugetlb /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
+/dev/sda1 /boot ext4 ro,noatime,nodiratime 0 0
+/dev/mapper/home /home ext4 rw,noatime,nodiratime,data=ordered 0 0
+/dev/mapper/logs /var/log ext4 rw,noatime,nodiratime,data=ordered 0 0
+/dev/mapper/tmp /tmp ext4 rw,noatime,nodiratime 0 0
+/dev/mapper/images /var/lib/libvirt/images ext4 rw,noatime,nodiratime,data=ordered 0 0
+binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
+/home/encrypted /home/decrypted ecryptfs rw,nosuid,nodev,noexec,relatime,ecryptfs_fnek_sig=abcdefabcdefabcd,ecryptfs_sig=efabcdefabcdefab,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_unlink_sigs 0 0
+/etc/autofs/auto.remote /mnt/remote autofs rw,relatime,fd=7,pgrp=511017,timeout=300,minproto=5,maxproto=5,indirect 0 0
diff --git a/tests/vircgroupdata/cgroups1.parsed b/tests/vircgroupdata/cgroups1.parsed
new file mode 100644
index 0000000..b6916f1
--- /dev/null
+++ b/tests/vircgroupdata/cgroups1.parsed
@@ -0,0 +1,10 @@
+cpu /sys/fs/cgroup/cpu
+cpuacct /sys/fs/cgroup/cpuacct
+cpuset /sys/fs/cgroup/cpuset
+memory /sys/fs/cgroup/memory
+devices /sys/fs/cgroup/devices
+freezer /sys/fs/cgroup/freezer
+blkio /sys/fs/cgroup/blkio
+net_cls /sys/fs/cgroup/net_cls
+perf_event <null>
+name=systemd <null>
diff --git a/tests/vircgroupdata/cgroups2.mounts b/tests/vircgroupdata/cgroups2.mounts
new file mode 100644
index 0000000..21ab867
--- /dev/null
+++ b/tests/vircgroupdata/cgroups2.mounts
@@ -0,0 +1,22 @@
+rootfs / rootfs rw 0 0
+proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
+udev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=1006404,mode=755 0 0
+devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
+sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
+/dev/sda1 / ext4 rw,noatime,data=ordered 0 0
+tmpfs /run tmpfs rw,nodev,relatime,size=812296k,mode=755 0 0
+mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
+shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0
+debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
+cgroup_root /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0
+openrc /sys/fs/cgroup/openrc cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc 0 0
+cpuset /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
+cpu /sys/fs/cgroup/cpu cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0
+cpuacct /sys/fs/cgroup/cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0
+memory /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
+devices /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
+freezer /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
+blkio /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
+perf_event /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
+hugetlb /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
+binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
diff --git a/tests/vircgroupdata/cgroups2.parsed b/tests/vircgroupdata/cgroups2.parsed
new file mode 100644
index 0000000..5eb2bc7
--- /dev/null
+++ b/tests/vircgroupdata/cgroups2.parsed
@@ -0,0 +1,10 @@
+cpu /sys/fs/cgroup/cpu
+cpuacct /sys/fs/cgroup/cpuacct
+cpuset /sys/fs/cgroup/cpuset
+memory /sys/fs/cgroup/memory
+devices /sys/fs/cgroup/devices
+freezer /sys/fs/cgroup/freezer
+blkio /sys/fs/cgroup/blkio
+net_cls <null>
+perf_event /sys/fs/cgroup/perf_event
+name=systemd <null>
diff --git a/tests/vircgroupdata/cgroups3.mounts b/tests/vircgroupdata/cgroups3.mounts
new file mode 100644
index 0000000..6d80e04
--- /dev/null
+++ b/tests/vircgroupdata/cgroups3.mounts
@@ -0,0 +1,28 @@
+/dev/rootvg/root / ext4 rw,noatime,data=ordered 0 0
+proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
+tmpfs /run tmpfs rw,nosuid,nodev,noexec,relatime,mode=755 0 0
+sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
+dev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=2039630,mode=755 0 0
+securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
+debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
+mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
+configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
+devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
+cgroup_root /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0
+tmpfs /dev/shm tmpfs rw,relatime 0 0
+fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
+efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0
+openrc /sys/fs/cgroup/openrc cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc 0 0
+cpuset /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
+cpu /sys/fs/cgroup/cpu cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0
+cpuacct /sys/fs/cgroup/cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0
+memory /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
+devices /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
+freezer /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
+net_cls /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0
+blkio /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
+perf_event /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
+net_prio /sys/fs/cgroup/net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_prio 0 0
+hugetlb /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
+tmpfs /tmp tmpfs rw,nosuid,noexec,relatime,size=3278448k 0 0
+binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
diff --git a/tests/vircgroupdata/cgroups3.parsed b/tests/vircgroupdata/cgroups3.parsed
new file mode 100644
index 0000000..2b1f382
--- /dev/null
+++ b/tests/vircgroupdata/cgroups3.parsed
@@ -0,0 +1,10 @@
+cpu /sys/fs/cgroup/cpu
+cpuacct /sys/fs/cgroup/cpuacct
+cpuset /sys/fs/cgroup/cpuset
+memory /sys/fs/cgroup/memory
+devices /sys/fs/cgroup/devices
+freezer /sys/fs/cgroup/freezer
+blkio /sys/fs/cgroup/blkio
+net_cls /sys/fs/cgroup/net_cls
+perf_event /sys/fs/cgroup/perf_event
+name=systemd <null>
diff --git a/tests/vircgroupdata/fedora-18.mounts b/tests/vircgroupdata/fedora-18.mounts
new file mode 100644
index 0000000..dfe2852
--- /dev/null
+++ b/tests/vircgroupdata/fedora-18.mounts
@@ -0,0 +1,30 @@
+rootfs / rootfs rw 0 0
+proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
+sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
+devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=2006080k,nr_inodes=501520,mode=755 0 0
+securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
+selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
+tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev 0 0
+devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
+tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0
+tmpfs /sys/fs/cgroup tmpfs rw,seclabel,nosuid,nodev,noexec,mode=755 0 0
+cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
+pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
+cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
+cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0
+cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
+cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
+cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
+cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0
+cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
+cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
+/dev/vda1 / ext4 rw,seclabel,relatime,data=ordered 0 0
+rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
+systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=27,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
+mqueue /dev/mqueue mqueue rw,seclabel,relatime 0 0
+tmpfs /tmp tmpfs rw,seclabel 0 0
+debugfs /sys/kernel/debug debugfs rw,relatime 0 0
+hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0
+configfs /sys/kernel/config configfs rw,relatime 0 0
+192.168.122.1:/home/qemu /home/qemu nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.122.1,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=192.168.122.1 0 0
+192.168.122.1:/var/lib/libvirt/images /var/lib/libvirt/images nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.122.1,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=192.168.122.1 0 0
diff --git a/tests/vircgroupdata/fedora-18.parsed b/tests/vircgroupdata/fedora-18.parsed
new file mode 100644
index 0000000..8d5ba75
--- /dev/null
+++ b/tests/vircgroupdata/fedora-18.parsed
@@ -0,0 +1,10 @@
+cpu /sys/fs/cgroup/cpu,cpuacct
+cpuacct /sys/fs/cgroup/cpu,cpuacct
+cpuset /sys/fs/cgroup/cpuset
+memory /sys/fs/cgroup/memory
+devices /sys/fs/cgroup/devices
+freezer /sys/fs/cgroup/freezer
+blkio /sys/fs/cgroup/blkio
+net_cls /sys/fs/cgroup/net_cls
+perf_event /sys/fs/cgroup/perf_event
+name=systemd /sys/fs/cgroup/systemd
diff --git a/tests/vircgroupdata/fedora-21.mounts b/tests/vircgroupdata/fedora-21.mounts
new file mode 100644
index 0000000..dfa0a0f
--- /dev/null
+++ b/tests/vircgroupdata/fedora-21.mounts
@@ -0,0 +1,33 @@
+rootfs / rootfs rw,seclabel 0 0
+sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
+proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
+devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=2013724k,nr_inodes=503431,mode=755 0 0
+securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
+tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev 0 0
+devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
+tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0
+tmpfs /sys/fs/cgroup tmpfs ro,seclabel,nosuid,nodev,noexec,mode=755 0 0
+cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
+pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
+cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
+cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
+cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
+cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
+cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
+cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
+cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
+cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
+cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
+configfs /sys/kernel/config configfs rw,relatime 0 0
+/dev/vda2 / ext4 rw,seclabel,relatime,data=ordered 0 0
+selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
+systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=28,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
+hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0
+mqueue /dev/mqueue mqueue rw,seclabel,relatime 0 0
+debugfs /sys/kernel/debug debugfs rw,relatime 0 0
+tmpfs /tmp tmpfs rw,seclabel 0 0
+sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
+nfsd /proc/fs/nfsd nfsd rw,relatime 0 0
+/dev/vda1 /boot ext4 rw,seclabel,relatime,data=ordered 0 0
+tmpfs /run/user/1000 tmpfs rw,seclabel,nosuid,nodev,relatime,size=404756k,mode=700,uid=1000,gid=1000 0 0
+tmpfs /run/user/0 tmpfs rw,seclabel,nosuid,nodev,relatime,size=404756k,mode=700 0 0
diff --git a/tests/vircgroupdata/fedora-21.parsed b/tests/vircgroupdata/fedora-21.parsed
new file mode 100644
index 0000000..3377af0
--- /dev/null
+++ b/tests/vircgroupdata/fedora-21.parsed
@@ -0,0 +1,10 @@
+cpu /sys/fs/cgroup/cpu,cpuacct
+cpuacct /sys/fs/cgroup/cpu,cpuacct
+cpuset /sys/fs/cgroup/cpuset
+memory /sys/fs/cgroup/memory
+devices /sys/fs/cgroup/devices
+freezer /sys/fs/cgroup/freezer
+blkio /sys/fs/cgroup/blkio
+net_cls /sys/fs/cgroup/net_cls,net_prio
+perf_event /sys/fs/cgroup/perf_event
+name=systemd /sys/fs/cgroup/systemd
diff --git a/tests/vircgroupdata/no-cgroups.mounts b/tests/vircgroupdata/no-cgroups.mounts
new file mode 100644
index 0000000..8173e41
--- /dev/null
+++ b/tests/vircgroupdata/no-cgroups.mounts
@@ -0,0 +1,10 @@
+rootfs / rootfs rw 0 0
+sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
+proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
+udev /dev devtmpfs rw,relatime,size=10240k,nr_inodes=256016,mode=755 0 0
+devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
+tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=206096k,mode=755 0 0
+/dev/disk/by-uuid/e5690604-413c-4782-ab67-b3678cea9f80 / ext4 rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered 0 0
+tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
+tmpfs /run/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=549800k 0 0
+rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
diff --git a/tests/vircgroupdata/no-cgroups.parsed b/tests/vircgroupdata/no-cgroups.parsed
new file mode 100644
index 0000000..bf4eea0
--- /dev/null
+++ b/tests/vircgroupdata/no-cgroups.parsed
@@ -0,0 +1,10 @@
+cpu <null>
+cpuacct <null>
+cpuset <null>
+memory <null>
+devices <null>
+freezer <null>
+blkio <null>
+net_cls <null>
+perf_event <null>
+name=systemd <null>
diff --git a/tests/vircgroupdata/ovirt-node-6.6.mounts b/tests/vircgroupdata/ovirt-node-6.6.mounts
new file mode 100644
index 0000000..ef07f4f
--- /dev/null
+++ b/tests/vircgroupdata/ovirt-node-6.6.mounts
@@ -0,0 +1,144 @@
+rootfs / rootfs rw 0 0
+proc /proc proc rw,relatime 0 0
+sysfs /sys sysfs rw,seclabel,relatime 0 0
+devtmpfs /dev devtmpfs rw,seclabel,relatime,size=132240744k,nr_inodes=33060186,mode=755 0 0
+devpts /dev/pts devpts rw,seclabel,relatime,gid=5,mode=620,ptmxmode=000 0 0
+tmpfs /dev/shm tmpfs rw,seclabel,relatime 0 0
+/dev/sdi2 /dev/.initramfs/live ext2 ro,seclabel,relatime,errors=continue 0 0
+/dev/mapper/live-rw / ext2 ro,seclabel,relatime,errors=continue,user_xattr,acl 0 0
+none /selinux selinuxfs rw,relatime 0 0
+devtmpfs /dev devtmpfs rw,seclabel,relatime,size=132240744k,nr_inodes=33060186,mode=755 0 0
+/proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0
+none /var/lib/stateless/writable tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/cache/man tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lock tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/log tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/run tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/dbus tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/nfs tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /tmp tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/cache/hald tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/dhclient tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/tmp tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /media tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/iscsi tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/logrotate.status tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/ntp tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/random-seed tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/spool tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /etc tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/net-snmp tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/dnsmasq tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /root/.ssh tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /root/.uml tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/cache/libvirt tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/libvirt tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/cache/multipathd tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /mnt tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /boot tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /boot-kdump tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /cgroup tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/yum tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/cache/yum tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /usr/share/snmp/mibs tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/lldpad tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/cache/rpcbind tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /usr/share/snmp/mibs tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/lldpad tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/cache/rpcbind tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/cache/rhn tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/db tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /usr/libexec/vdsm/hooks tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /var/lib/vdsm tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+none /rhev/data-center tmpfs rw,rootcontext=system_u:object_r:var_lib_t:s0,seclabel,relatime 0 0
+/dev/mapper/HostVG-Config /config ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/fstab ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/shadow ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/default/ovirt ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/rsyslog.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/libvirt/passwd.db ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/passwd ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/libvirt/qemu/networks ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/sshd_config ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/pki ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/iscsi/initiatorname.iscsi ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/random-seed ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/keyboard ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/iptables ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/resolv.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ntp.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/hosts ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/shadow ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/vdsm/vdsm.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/vdsm-reg/vdsm-reg.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-lo ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/multipath.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/shadow ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/virt-who ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/vdsm/persistence ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+tmpfs /dev/shm tmpfs rw,rootcontext=system_u:object_r:tmpfs_t:s0,seclabel,relatime 0 0
+debugfs /sys/kernel/debug debugfs rw,relatime 0 0
+/dev/mapper/HostVG-Logging /var/log ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0
+/dev/mapper/HostVG-Data /data ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0
+/dev/mapper/HostVG-Data /var/lib/libvirt/images ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0
+/dev/mapper/HostVG-Data /var/log/core ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0
+none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
+/dev/mapper/HostVG-Logging /tmp/early-logs ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_key ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_key.pub ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_dsa_key ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_dsa_key.pub ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_rsa_key ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_rsa_key.pub ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/udev/rules.d/71-persistent-node-net.rules ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/vdsm/vdsm.id ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/udev/rules.d/12-ovirt-iosched.rules ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /root/.ssh/authorized_keys ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/vdsm/upgrade/upgrade-unified-persistence ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.11 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.100 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.200 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.21 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.3 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.31 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.4 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.41 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.5 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.51 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.6 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-eth0 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-eth1 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-eth2 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-eth3 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-rhevm ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_info ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_migration ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_servers ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_test ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_views ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_vms_ant ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_vms_lim ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_vms_ovl ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_vms_vlb ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_vms_wvl ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-bond0.10 ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-vnet_personeel ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+tmpfs /dev/shm tmpfs rw,rootcontext=system_u:object_r:tmpfs_t:s0,seclabel,relatime 0 0
+/dev/mapper/HostVG-Data /var/lib/libvirt/images ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0
+/dev/mapper/HostVG-Data /var/log/core ext4 rw,seclabel,noatime,barrier=0,stripe=64,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/libvirt/libvirtd.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/libvirtd ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/libvirt/qemu.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/libvirt/qemu-sanlock.conf ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/logrotate.d/libvirtd ext4 rw,seclabel,noatime,barrier=0,stripe=256,data=ordered 0 0
+cgroup /cgroup/cpuset cgroup rw,relatime,cpuset 0 0
+cgroup /cgroup/cpu cgroup rw,relatime,cpu 0 0
+cgroup /cgroup/cpuacct cgroup rw,relatime,cpuacct 0 0
+cgroup /cgroup/memory cgroup rw,relatime,memory 0 0
+cgroup /cgroup/devices cgroup rw,relatime,devices 0 0
+cgroup /cgroup/freezer cgroup rw,relatime,freezer 0 0
+cgroup /cgroup/net_cls cgroup rw,relatime,net_cls 0 0
+cgroup /cgroup/blkio cgroup rw,relatime,blkio 0 0
+sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
diff --git a/tests/vircgroupdata/ovirt-node-6.6.parsed b/tests/vircgroupdata/ovirt-node-6.6.parsed
new file mode 100644
index 0000000..01bf466
--- /dev/null
+++ b/tests/vircgroupdata/ovirt-node-6.6.parsed
@@ -0,0 +1,10 @@
+cpu /cgroup/cpu
+cpuacct /cgroup/cpuacct
+cpuset /cgroup/cpuset
+memory /cgroup/memory
+devices /cgroup/devices
+freezer /cgroup/freezer
+blkio /cgroup/blkio
+net_cls /cgroup/net_cls
+perf_event <null>
+name=systemd <null>
diff --git a/tests/vircgroupdata/ovirt-node-7.1.mounts b/tests/vircgroupdata/ovirt-node-7.1.mounts
new file mode 100644
index 0000000..74f7db9
--- /dev/null
+++ b/tests/vircgroupdata/ovirt-node-7.1.mounts
@@ -0,0 +1,142 @@
+rootfs / rootfs rw 0 0
+proc /proc proc rw,relatime 0 0
+sysfs /sys sysfs rw,seclabel,relatime 0 0
+devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=3922156k,nr_inodes=980539,mode=755 0 0
+securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
+tmpfs /dev/shm tmpfs rw,seclabel,relatime 0 0
+devpts /dev/pts devpts rw,seclabel,relatime,gid=5,mode=620,ptmxmode=000 0 0
+tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0
+tmpfs /sys/fs/cgroup tmpfs rw,seclabel,nosuid,nodev,noexec,mode=755 0 0
+cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
+pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
+cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
+cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0
+cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
+cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
+cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
+cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0
+cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
+cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
+cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
+configfs /sys/kernel/config configfs rw,relatime 0 0
+/dev/sda3 /run/initramfs/live ext2 ro,seclabel,relatime 0 0
+/dev/mapper/live-rw / ext2 ro,seclabel,noatime 0 0
+rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
+selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
+systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=33,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
+mqueue /dev/mqueue mqueue rw,seclabel,relatime 0 0
+hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0
+debugfs /sys/kernel/debug debugfs rw,relatime 0 0
+none /var/lib/stateless/writable tmpfs rw,seclabel,relatime 0 0
+none /var/cache/man tmpfs rw,seclabel,relatime 0 0
+none /var/log tmpfs rw,seclabel,relatime 0 0
+none /var/lib/dbus tmpfs rw,seclabel,relatime 0 0
+none /tmp tmpfs rw,seclabel,relatime 0 0
+none /var/lib/dhclient tmpfs rw,seclabel,relatime 0 0
+none /var/tmp tmpfs rw,seclabel,relatime 0 0
+none /var/lib/iscsi tmpfs rw,seclabel,relatime 0 0
+none /var/lib/logrotate.status tmpfs rw,seclabel,relatime 0 0
+none /var/lib/ntp tmpfs rw,seclabel,relatime 0 0
+none /var/lib/random-seed tmpfs rw,seclabel,relatime 0 0
+none /var/spool tmpfs rw,seclabel,relatime 0 0
+none /var/lib/nfs tmpfs rw,seclabel,relatime 0 0
+none /var/lib/ovirt-hosted-engine-setup tmpfs rw,seclabel,relatime 0 0
+none /etc tmpfs rw,seclabel,relatime 0 0
+none /var/lib/net-snmp tmpfs rw,seclabel,relatime 0 0
+none /var/lib/dnsmasq tmpfs rw,seclabel,relatime 0 0
+none /root/.ssh tmpfs rw,seclabel,relatime 0 0
+none /root/.uml tmpfs rw,seclabel,relatime 0 0
+none /var/cache/libvirt tmpfs rw,seclabel,relatime 0 0
+none /var/lib/libvirt tmpfs rw,seclabel,relatime 0 0
+none /var/cache/multipathd tmpfs rw,seclabel,relatime 0 0
+none /mnt tmpfs rw,seclabel,relatime 0 0
+none /boot tmpfs rw,seclabel,relatime 0 0
+none /boot-kdump tmpfs rw,seclabel,relatime 0 0
+none /var/lib/yum tmpfs rw,seclabel,relatime 0 0
+none /var/cache/yum tmpfs rw,seclabel,relatime 0 0
+none /usr/share/snmp/mibs tmpfs rw,seclabel,relatime 0 0
+none /var/lib/lldpad tmpfs rw,seclabel,relatime 0 0
+none /usr/share/snmp/mibs tmpfs rw,seclabel,relatime 0 0
+none /var/lib/stateless/writable/usr/share/snmp/mibs tmpfs rw,seclabel,relatime 0 0
+none /var/lib/lldpad tmpfs rw,seclabel,relatime 0 0
+none /var/lib/stateless/writable/var/lib/lldpad tmpfs rw,seclabel,relatime 0 0
+none /var/cache/rhn tmpfs rw,seclabel,relatime 0 0
+none /var/db tmpfs rw,seclabel,relatime 0 0
+none /usr/libexec/vdsm/hooks tmpfs rw,seclabel,relatime 0 0
+none /var/lib/vdsm tmpfs rw,seclabel,relatime 0 0
+none /rhev/data-center tmpfs rw,seclabel,relatime 0 0
+none /var/lib/dhclient tmpfs rw,seclabel,relatime 0 0
+none /var/lib/stateless/writable/var/lib/dhclient tmpfs rw,seclabel,relatime 0 0
+/dev/mapper/HostVG-Config /config ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/fstab ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/fstab ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/hosts ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/hosts ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/sysconfig/network ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-lo ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/sysconfig/network-scripts/ifcfg-lo ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/resolv.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/resolv.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ntp.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ntp.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/sshd_config ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/sshd_config ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/kdump.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/kdump.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/default/ovirt ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/default/ovirt ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/rsyslog.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/rsyslog.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/libvirt/passwd.db ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/libvirt/passwd.db ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/libvirt/qemu ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/libvirt/qemu ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/pki ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/pki ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/iscsi/initiatorname.iscsi ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/iscsi/initiatorname.iscsi ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/random-seed ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/var/lib/random-seed ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/glusterd ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/virt-who ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/sysconfig/virt-who ext4 rw,seclabel,noatime,data=ordered 0 0
+sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
+sunrpc /var/lib/stateless/writable/var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
+none /tmp/early-logs tmpfs rw,seclabel,relatime 0 0
+none /var/lib/stateless/writable/tmp/early-logs tmpfs rw,seclabel,relatime 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/network-scripts/ifcfg-em1 ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/sysconfig/network-scripts/ifcfg-em1 ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_rsa_key ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_rsa_key ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_rsa_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_rsa_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_ecdsa_key ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_ecdsa_key ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_ecdsa_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_ecdsa_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_ed25519_key ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_ed25519_key ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/ssh/ssh_host_ed25519_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/ssh/ssh_host_ed25519_key.pub ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Logging /var/log ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Logging /var/lib/stateless/writable/tmp/early-logs ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Logging /var/lib/stateless/writable/var/log ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Data /data ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Data /var/lib/libvirt/images ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Data /var/lib/stateless/writable/var/lib/libvirt/images ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Data /var/log/core ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Data /var/lib/stateless/writable/tmp/early-logs/core ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Data /var/lib/stateless/writable/var/log/core ext4 rw,seclabel,noatime,data=ordered 0 0
+tmpfs /dev/.initramfs tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0
+/dev/sda3 /dev/.initramfs/live ext2 ro,seclabel,relatime 0 0
+/dev/mapper/HostVG-Config /etc/libvirt/libvirtd.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/libvirt/libvirtd.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/sysconfig/libvirtd ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/sysconfig/libvirtd ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/libvirt/qemu.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/libvirt/qemu.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/libvirt/qemu-sanlock.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/libvirt/qemu-sanlock.conf ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /etc/logrotate.d/libvirtd ext4 rw,seclabel,noatime,data=ordered 0 0
+/dev/mapper/HostVG-Config /var/lib/stateless/writable/etc/logrotate.d/libvirtd ext4 rw,seclabel,noatime,data=ordered 0 0
diff --git a/tests/vircgroupdata/ovirt-node-7.1.parsed b/tests/vircgroupdata/ovirt-node-7.1.parsed
new file mode 100644
index 0000000..8d5ba75
--- /dev/null
+++ b/tests/vircgroupdata/ovirt-node-7.1.parsed
@@ -0,0 +1,10 @@
+cpu /sys/fs/cgroup/cpu,cpuacct
+cpuacct /sys/fs/cgroup/cpu,cpuacct
+cpuset /sys/fs/cgroup/cpuset
+memory /sys/fs/cgroup/memory
+devices /sys/fs/cgroup/devices
+freezer /sys/fs/cgroup/freezer
+blkio /sys/fs/cgroup/blkio
+net_cls /sys/fs/cgroup/net_cls
+perf_event /sys/fs/cgroup/perf_event
+name=systemd /sys/fs/cgroup/systemd
diff --git a/tests/vircgroupdata/rhel-7.1.mounts b/tests/vircgroupdata/rhel-7.1.mounts
new file mode 100644
index 0000000..1d6aaea
--- /dev/null
+++ b/tests/vircgroupdata/rhel-7.1.mounts
@@ -0,0 +1,31 @@
+rootfs / rootfs rw 0 0
+proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
+sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
+devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=3038192k,nr_inodes=759548,mode=755 0 0
+securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
+tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev 0 0
+devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
+tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0
+tmpfs /sys/fs/cgroup tmpfs rw,seclabel,nosuid,nodev,noexec,mode=755 0 0
+cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
+pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
+cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
+cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0
+cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
+cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
+cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
+cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0
+cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
+cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
+cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
+configfs /sys/kernel/config configfs rw,relatime 0 0
+/dev/sda7 / ext4 rw,seclabel,relatime,data=ordered 0 0
+selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
+systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=36,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
+mqueue /dev/mqueue mqueue rw,seclabel,relatime 0 0
+debugfs /sys/kernel/debug debugfs rw,relatime 0 0
+hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0
+sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
+nfsd /proc/fs/nfsd nfsd rw,relatime 0 0
+/dev/sda4 /home ext4 rw,seclabel,relatime,data=ordered 0 0
+colossus:/data/nfsroot /virt-nfs nfs4 rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=1.2.3.4,local_lock=none,addr=1.2.3.5 0 0
diff --git a/tests/vircgroupdata/rhel-7.1.parsed b/tests/vircgroupdata/rhel-7.1.parsed
new file mode 100644
index 0000000..8d5ba75
--- /dev/null
+++ b/tests/vircgroupdata/rhel-7.1.parsed
@@ -0,0 +1,10 @@
+cpu /sys/fs/cgroup/cpu,cpuacct
+cpuacct /sys/fs/cgroup/cpu,cpuacct
+cpuset /sys/fs/cgroup/cpuset
+memory /sys/fs/cgroup/memory
+devices /sys/fs/cgroup/devices
+freezer /sys/fs/cgroup/freezer
+blkio /sys/fs/cgroup/blkio
+net_cls /sys/fs/cgroup/net_cls
+perf_event /sys/fs/cgroup/perf_event
+name=systemd /sys/fs/cgroup/systemd
diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c
index cc1825b..efad77d 100644
--- a/tests/vircgrouptest.c
+++ b/tests/vircgrouptest.c
@@ -158,6 +158,58 @@ const char *linksLogind[VIR_CGROUP_CONTROLLER_LAST] = {
};
+static int
+testCgroupDetectMounts(const void *args)
+{
+ int result = -1;
+ const char *file = args;
+ char *mounts = NULL;
+ char *parsed = NULL;
+ char *expected = NULL;
+ const char *actual;
+ virCgroupPtr group = NULL;
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+ size_t i;
+
+ if (virAsprintf(&mounts, "%s/vircgroupdata/%s.mounts",
+ abs_srcdir, file) < 0 ||
+ virAsprintf(&parsed, "%s/vircgroupdata/%s.parsed",
+ abs_srcdir, file) < 0 ||
+ VIR_ALLOC(group) < 0)
+ goto cleanup;
+
+ if (virCgroupDetectMountsFromFile(group, mounts, false) < 0)
+ goto cleanup;
+
+ if (virtTestLoadFile(parsed, &expected) < 0)
+ goto cleanup;
+
+ for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
+ virBufferAsprintf(&buf, "%-12s %s\n",
+ virCgroupControllerTypeToString(i),
+ NULLSTR(group->controllers[i].mountPoint));
+ }
+ if (virBufferCheckError(&buf) < 0)
+ goto cleanup;
+
+ actual = virBufferCurrentContent(&buf);
+ if (STRNEQ(expected, actual)) {
+ virtTestDifference(stderr, expected, actual);
+ goto cleanup;
+ }
+
+ result = 0;
+
+ cleanup:
+ VIR_FREE(mounts);
+ VIR_FREE(parsed);
+ VIR_FREE(expected);
+ virCgroupFree(&group);
+ virBufferFreeAndReset(&buf);
+ return result;
+}
+
+
static int testCgroupNewForSelf(const void *args ATTRIBUTE_UNUSED)
{
virCgroupPtr cgroup = NULL;
@@ -793,6 +845,25 @@ mymain(void)
setenv("LIBVIRT_FAKE_SYSFS_DIR", fakesysfsdir, 1);
+# define DETECT_MOUNTS(file) \
+ do { \
+ if (virtTestRun("Detect cgroup mounts for " file, \
+ testCgroupDetectMounts, \
+ file) < 0) \
+ ret = -1; \
+ } while (0)
+
+ DETECT_MOUNTS("ovirt-node-6.6");
+ DETECT_MOUNTS("ovirt-node-7.1");
+ DETECT_MOUNTS("fedora-18");
+ DETECT_MOUNTS("fedora-21");
+ DETECT_MOUNTS("rhel-7.1");
+ DETECT_MOUNTS("cgroups1");
+ DETECT_MOUNTS("cgroups2");
+ DETECT_MOUNTS("cgroups3");
+ DETECT_MOUNTS("all-in-one");
+ DETECT_MOUNTS("no-cgroups");
+
if (virtTestRun("New cgroup for self", testCgroupNewForSelf, NULL) < 0)
ret = -1;
--
2.3.3
9 years, 8 months
[libvirt] [PATCH v3 0/7] bridge network support enhancement and other network fixes
by Maxim Nestratov
v3 change:
Addressed Michal Privoznik's comments
Maxim Nestratov (7):
parallels: introduce and use string constants for network types and
names
parallels: fix parallelsLoadNetworks
parallels: better bridge network interface support
parallels: set correct network adapter device state
parallels: make E1000 network adapter model default
parallels: switch off offline management feature
parallels: don't prevent domain define if VIR_DOMAIN_NET_TYPE_BRIDGE
9 years, 8 months
[libvirt] [libvirt-test-API][PATCH v2 0/2] Add test cases for setTime and getTime
by Jincheng Miao
create some test cases for libvirt-python API setTime and getTime
v2:
user should pass 'seconds' to set_guest_time, and 'nseconds' is optional.
Jincheng Miao (2):
Add guest setTime and getTime testing
Add test cases for linux_domain
cases/linux_domain.conf | 30 ++++++++++
repos/domain/guest_time.py | 98 ++++++++++++++++++++++++++++++++
repos/domain/set_guest_time.py | 122 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 250 insertions(+), 0 deletions(-)
create mode 100644 repos/domain/guest_time.py
create mode 100644 repos/domain/set_guest_time.py
9 years, 8 months
[libvirt] Enhancing block/disk migration in libvirt
by Tony Breeds
Hello all,
I'm new to both openstack and libvirt so I may get some of this slightly
wrong[1].
Here is some context form the openstack world (which at least some of you are
aware of). There are at least 2 open bug against openstack (nova) in the area
of block/disk migration.
1) Live migration fails when the instance has a config-drive[2]
Here openstack(nova) fails because a drive that nova expects to be migrated
isn't migrated.
2) libvirt live_snapshot periodically explodes on libvirt 1.2.2 in the gate[3]
Here openstack(nova) fails because a drive that nova expects NOT to be
migrated is migrated.
To me these are essentially the same bug/issue. There is no way to communicate with
libvirt the users expectations around block/disk mirgration.
My idea so far would be to add an options element to the 'disk' XML node.
This element could start with 3 possible states
block_migration="default": Let libvirt decide
block_migration="yes": This device should be block migrated
block_migration="no": This device should *NOT* be block migrated
The absence of this element would be treated as "default" above.
This would mean that all existing domain XML would still be valid and have the
expected behaviour and users (such as opensatck) can be explicit about deviced
that do/do not need to be block migrated.
While I'm certainly open to discussing the finer points of the implementation,
right now I'm interested in getting a feel for is this idea generally ok?
Yours Tony.
[1] I'm happy to be corrected / pointed at community guidelines that I may
have missed.
[2] https://bugs.launchpad.net/nova/+bug/1246201
[3] https://bugs.launchpad.net/nova/+bug/1334398
9 years, 8 months
[libvirt] [PATCH python v10] Expose virDomainInterfacesAddresses to python binding
by Daniel P. Berrange
From: Nehal J Wani <nehaljw.kkd1(a)gmail.com>
examples/Makefile.am:
* Add new file domipaddrs.py
examples/README:
* Add documentation for the python example
libvirt-override-api.xml:
* Add new symbol for virDomainInterfacesAddresses
libvirt-override.c:
* Hand written python api
Example:
$ python examples/domipaddrs.py qemu:///system f18
Interface MAC address Protocol Address
lo 00:00:00:00:00:00 ipv4 127.0.0.1/8
lo 00:00:00:00:00:00 ipv6 ::1/128
eth3 52:54:00:20:70:3d ipv4 192.168.105.240/16
eth3 52:54:00:20:70:3d ipv6 fe80::5054:ff:fe20:703d/64
eth2 52:54:00:36:2a:e5 N/A N/A
eth1 52:54:00:b1:70:19 ipv4 192.168.105.201/16
eth1 52:54:00:b1:70:19 ipv4 192.168.201.195/16
eth1 52:54:00:b1:70:19 ipv6 fe80::5054:ff:feb1:7019/64
eth0 52:54:00:2e:45:ce ipv4 10.1.33.188/24
eth0 52:54:00:2e:45:ce ipv6 2001:db8:0:f101::2/64
eth0 52:54:00:2e:45:ce ipv6 fe80::5054:ff:fe2e:45ce/64
---
MANIFEST.in | 1 +
examples/README | 1 +
examples/domipaddrs.py | 57 +++++++++++++++++++++++++
generator.py | 2 +
libvirt-override-api.xml | 9 +++-
libvirt-override.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++
sanitytest.py | 3 ++
7 files changed, 177 insertions(+), 1 deletion(-)
create mode 100755 examples/domipaddrs.py
diff --git a/MANIFEST.in b/MANIFEST.in
index d7bc545..dd05221 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -4,6 +4,7 @@ include COPYING
include COPYING.LESSER
include ChangeLog
include examples/consolecallback.py
+include examples/domipaddrs.py
include examples/dominfo.py
include examples/domrestore.py
include examples/domsave.py
diff --git a/examples/README b/examples/README
index 5b5d405..1d4b425 100644
--- a/examples/README
+++ b/examples/README
@@ -11,6 +11,7 @@ domrestore.py - restore domU's from their saved files in a directory
esxlist.py - list active domains of an VMware ESX host and print some info.
also demonstrates how to use the libvirt.openAuth() method
dhcpleases.py - list dhcp leases for a given virtual network
+domipaddrs.py - list IP addresses for guest domains
The XML files in this directory are examples of the XML format that libvirt
expects, and will have to be adapted for your setup. They are only needed
diff --git a/examples/domipaddrs.py b/examples/domipaddrs.py
new file mode 100755
index 0000000..d6d5cac
--- /dev/null
+++ b/examples/domipaddrs.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+# domipaddrs - print domain interfaces along with their MAC and IP addresses
+
+import libvirt
+import sys
+
+def usage():
+ print "Usage: %s [URI] DOMAIN" % sys.argv[0]
+ print " Print domain interfaces along with their MAC and IP addresses"
+
+uri = None
+name = None
+args = len(sys.argv)
+
+if args == 2:
+ name = sys.argv[1]
+elif args == 3:
+ uri = sys.argv[1]
+ name = sys.argv[2]
+else:
+ usage()
+ sys.exit(2)
+
+conn = libvirt.open(uri)
+if conn == None:
+ print "Unable to open connection to libvirt"
+ sys.exit(1)
+
+try:
+ dom = conn.lookupByName(name)
+except libvirt.libvirtError:
+ print "Domain %s not found" % name
+ sys.exit(0)
+
+ifaces = dom.interfaceAddresses(libvirt.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE);
+if (ifaces == None):
+ print "Failed to get domain interfaces"
+ sys.exit(0)
+
+print " {0:10} {1:20} {2:12} {3}".format("Interface", "MAC address", "Protocol", "Address")
+
+def toIPAddrType(addrType):
+ if addrType == libvirt.VIR_IP_ADDR_TYPE_IPV4:
+ return "ipv4"
+ elif addrType == libvirt.VIR_IP_ADDR_TYPE_IPV6:
+ return "ipv6"
+
+for (name, val) in ifaces.iteritems():
+ if val['addrs']:
+ for addr in val['addrs']:
+ print " {0:10} {1:19}".format(name, val['hwaddr']),
+ print " {0:12} {1}/{2} ".format(toIPAddrType(addr['type']), addr['addr'], addr['prefix']),
+ print
+ else:
+ print " {0:10} {1:19}".format(name, val['hwaddr']),
+ print " {0:12} {1}".format("N/A", "N/A"),
+ print
diff --git a/generator.py b/generator.py
index df7a74d..8c1c48e 100755
--- a/generator.py
+++ b/generator.py
@@ -483,6 +483,7 @@ skip_impl = (
'virDomainBlockCopy',
'virNodeAllocPages',
'virDomainGetFSInfo',
+ 'virDomainInterfaceAddresses',
)
lxc_skip_impl = (
@@ -595,6 +596,7 @@ skip_function = (
'virDomainStatsRecordListFree', # only useful in C, python uses dict
'virDomainFSInfoFree', # only useful in C, python code uses list
'virDomainIOThreadsInfoFree', # only useful in C, python code uses list
+ 'virDomainInterfaceFree', # only useful in C, python code uses list
)
lxc_skip_function = (
diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml
index 4660c9f..b197639 100644
--- a/libvirt-override-api.xml
+++ b/libvirt-override-api.xml
@@ -678,5 +678,12 @@
<arg name='flags' type='unsigned int' info='unused, pass 0'/>
<return type='char *' info="list of mounted filesystems information"/>
</function>
- </symbols>
+ <function name='virDomainInterfaceAddresses' file='python'>
+ <info>returns a dictionary of domain interfaces along with their MAC and IP addresses</info>
+ <arg name='dom' type='virDomainPtr' info='pointer to the domain'/>
+ <arg name='source' type='unsigned int' info='the data source'/>
+ <arg name='flags' type='unsigned int' info='extra flags; not used yet, so callers should always pass 0'/>
+ <return type='char *' info="dictionary of domain interfaces along with their MAC and IP addresses"/>
+ </function>
+</symbols>
</api>
diff --git a/libvirt-override.c b/libvirt-override.c
index 1241305..bf3cb70 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -5120,6 +5120,108 @@ cleanup:
return py_retval;
}
+
+static PyObject *
+libvirt_virDomainInterfaceAddresses(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args)
+{
+ PyObject *py_retval = VIR_PY_NONE;
+ virDomainPtr domain;
+ PyObject *pyobj_domain;
+ unsigned int source;
+ unsigned int flags;
+ virDomainInterfacePtr *ifaces = NULL;
+ int ifaces_count = 0;
+ size_t i, j;
+ int ret;
+ bool full_free = true;
+
+ if (!PyArg_ParseTuple(args, (char *) "Oii:virDomainInterfacePtr",
+ &pyobj_domain, &source, &flags))
+ return NULL;
+
+ domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ ifaces_count = virDomainInterfaceAddresses(domain, &ifaces, source, flags);
+ ret = ifaces_count;
+ LIBVIRT_END_ALLOW_THREADS;
+ if (ret < 0)
+ goto cleanup;
+
+ if (!(py_retval = PyDict_New()))
+ goto no_memory;
+
+ for (i = 0; i < ifaces_count; i++) {
+ virDomainInterfacePtr iface = ifaces[i];
+ PyObject *py_addrs = NULL;
+ PyObject *py_iface = NULL;
+
+ if (!(py_iface = PyDict_New()))
+ goto no_memory;
+
+ if (iface->naddrs) {
+ if (!(py_addrs = PyList_New(iface->naddrs))) {
+ Py_DECREF(py_iface);
+ goto no_memory;
+ }
+ } else {
+ py_addrs = VIR_PY_NONE;
+ }
+
+ for (j = 0; j < iface->naddrs; j++) {
+ virDomainIPAddressPtr addr = &(iface->addrs[j]);
+ PyObject *py_addr = PyDict_New();
+ int type = addr->type;
+
+ if (!addr) {
+ Py_DECREF(py_iface);
+ Py_DECREF(py_addrs);
+ goto no_memory;
+ }
+
+ PyDict_SetItem(py_addr, libvirt_constcharPtrWrap("addr"),
+ libvirt_constcharPtrWrap(addr->addr));
+ PyDict_SetItem(py_addr, libvirt_constcharPtrWrap("prefix"),
+ libvirt_intWrap(addr->prefix));
+ PyDict_SetItem(py_addr, libvirt_constcharPtrWrap("type"),
+ libvirt_intWrap(type));
+
+ PyList_SetItem(py_addrs, j, py_addr);
+ }
+
+ PyDict_SetItem(py_iface, libvirt_constcharPtrWrap("addrs"),
+ py_addrs);
+ PyDict_SetItem(py_iface, libvirt_constcharPtrWrap("hwaddr"),
+ libvirt_constcharPtrWrap(iface->hwaddr));
+
+ PyDict_SetItem(py_retval, libvirt_charPtrWrap(iface->name),
+ py_iface);
+ }
+
+ full_free = false;
+
+cleanup:
+ if (ifaces && ifaces_count > 0) {
+ for (i = 0; full_free && i < ifaces_count; i++) {
+ /*
+ * We don't want to free values we've just shared with python variables unless
+ * there was an error and hence we are returning PY_NONE or equivalent
+ */
+ virDomainInterfaceFree(ifaces[i]);
+ }
+ }
+ VIR_FREE(ifaces);
+
+ return py_retval;
+
+no_memory:
+ Py_XDECREF(py_retval);
+ py_retval = PyErr_NoMemory();
+ goto cleanup;
+}
+
+
/*******************************************
* Helper functions to avoid importing modules
* for every callback
@@ -8750,6 +8852,9 @@ static PyMethodDef libvirtMethods[] = {
#if LIBVIR_CHECK_VERSION(1, 2, 11)
{(char *) "virDomainGetFSInfo", libvirt_virDomainGetFSInfo, METH_VARARGS, NULL},
#endif /* LIBVIR_CHECK_VERSION(1, 2, 11) */
+#if LIBVIR_CHECK_VERSION(1, 2, 14)
+ {(char *) "virDomainInterfaceAddresses", libvirt_virDomainInterfaceAddresses, METH_VARARGS, NULL},
+#endif /* LIBVIR_CHECK_VERSION(1, 2, 14) */
{NULL, NULL, 0, NULL}
};
diff --git a/sanitytest.py b/sanitytest.py
index 0e6e0e5..2b609a9 100644
--- a/sanitytest.py
+++ b/sanitytest.py
@@ -145,6 +145,9 @@ for cname in wantfunctions:
if name[0:26] == "virDomainIOThreadsInfoFree":
continue
+ if name[0:33] == "virDomainInterfaceFree":
+ continue
+
if name[0:21] == "virDomainListGetStats":
name = "virConnectDomainListGetStats"
--
2.1.0
9 years, 8 months
[libvirt] [PATCH v10 0/4] Introduce API to query IP addresses for given domain
by Daniel P. Berrange
In v10
- Remove 'if' tests before access of hwaddr as it is always present
- Switch remote protocol to use remote_nonnull_string for hwaddr
as it can never be NUL
- Misc typos Eric pointed out
Nehal J Wani (4):
domifaddr: Implement the public APIs
domifaddr: Implement the remote protocol
domifaddr: Implement the API for qemu
domifaddr: Add virsh support
daemon/remote.c | 124 ++++++++++++++++++++++++
include/libvirt/libvirt-domain.h | 32 ++++++
src/driver-hypervisor.h | 6 ++
src/libvirt-domain.c | 123 +++++++++++++++++++++++
src/libvirt_public.syms | 2 +
src/qemu/qemu_agent.c | 204 +++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 4 +
src/qemu/qemu_driver.c | 175 +++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 103 ++++++++++++++++++++
src/remote/remote_protocol.x | 37 ++++++-
src/remote_protocol-structs | 25 +++++
tests/qemuagenttest.c | 188 ++++++++++++++++++++++++++++++++++++
tools/virsh-domain-monitor.c | 146 ++++++++++++++++++++++++++++
tools/virsh.pod | 16 +++
14 files changed, 1184 insertions(+), 1 deletion(-)
--
2.1.0
9 years, 8 months