[libvirt] [PATCH v2 9/9] vircgrouptest: call virCgroupNewSelf instead virCgroupDetectMounts
Ján Tomko
jtomko at redhat.com
Mon Sep 24 15:42:48 UTC 2018
On Thu, Sep 20, 2018 at 10:54:38AM +0200, Pavel Hrdina wrote:
>This will be required once cgroup v2 is introduced. The cgroup
>detection is not simple and we will have multiple backends so we
>should not just jump into the middle of the detection code.
>
>In order to use virCgroupNewSelf we need to create all the remaining
>data files:
>
> - {name}.cgroups represents /proc/cgroups, it is a list of cgroup
> controllers compiled into kernel
>
> - {name}.self.cgroup represents /proc/self/cgroup, it describes
> cgroups to which the process belongs
>
>For "no-cgroups" we need to modify the expected behavior because
>virCgroupNewSelf() will fail if there are no controllers available.
>
>Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
>---
>
>Notes:
> changes in v2:
> - no-cgroups detect test is now expected to fail
>
> src/libvirt_private.syms | 1 -
> src/util/vircgroup.c | 11 +------
> src/util/vircgrouppriv.h | 2 --
> tests/vircgroupdata/cgroups1.cgroups | 11 +++++++
> tests/vircgroupdata/cgroups1.self.cgroup | 11 +++++++
> tests/vircgroupdata/cgroups2.cgroups | 10 +++++++
> tests/vircgroupdata/cgroups2.self.cgroup | 10 +++++++
> tests/vircgroupdata/cgroups3.cgroups | 12 ++++++++
> tests/vircgroupdata/cgroups3.self.cgroup | 12 ++++++++
> tests/vircgroupdata/fedora-18.cgroups | 10 +++++++
> tests/vircgroupdata/fedora-18.self.cgroup | 9 ++++++
> tests/vircgroupdata/fedora-21.cgroups | 12 ++++++++
> tests/vircgroupdata/fedora-21.self.cgroup | 10 +++++++
> tests/vircgroupdata/kubevirt.cgroups | 10 +++++++
> tests/vircgroupdata/kubevirt.self.cgroup | 10 +++++++
> tests/vircgroupdata/no-cgroups.cgroups | 8 +++++
> tests/vircgroupdata/no-cgroups.parsed | 10 -------
> tests/vircgroupdata/no-cgroups.self.cgroup | 0
> tests/vircgroupdata/ovirt-node-6.6.cgroups | 9 ++++++
> .../vircgroupdata/ovirt-node-6.6.self.cgroup | 8 +++++
> tests/vircgroupdata/ovirt-node-7.1.cgroups | 11 +++++++
> .../vircgroupdata/ovirt-node-7.1.self.cgroup | 10 +++++++
> tests/vircgroupdata/rhel-7.1.cgroups | 11 +++++++
> tests/vircgroupdata/rhel-7.1.self.cgroup | 10 +++++++
> tests/vircgrouptest.c | 30 ++++++++++++++-----
> 25 files changed, 217 insertions(+), 31 deletions(-)
> create mode 100644 tests/vircgroupdata/cgroups1.cgroups
> create mode 100644 tests/vircgroupdata/cgroups1.self.cgroup
> create mode 100644 tests/vircgroupdata/cgroups2.cgroups
> create mode 100644 tests/vircgroupdata/cgroups2.self.cgroup
> create mode 100644 tests/vircgroupdata/cgroups3.cgroups
> create mode 100644 tests/vircgroupdata/cgroups3.self.cgroup
> create mode 100644 tests/vircgroupdata/fedora-18.cgroups
> create mode 100644 tests/vircgroupdata/fedora-18.self.cgroup
> create mode 100644 tests/vircgroupdata/fedora-21.cgroups
> create mode 100644 tests/vircgroupdata/fedora-21.self.cgroup
> create mode 100644 tests/vircgroupdata/kubevirt.cgroups
> create mode 100644 tests/vircgroupdata/kubevirt.self.cgroup
> create mode 100644 tests/vircgroupdata/no-cgroups.cgroups
> delete mode 100644 tests/vircgroupdata/no-cgroups.parsed
> create mode 100644 tests/vircgroupdata/no-cgroups.self.cgroup
> create mode 100644 tests/vircgroupdata/ovirt-node-6.6.cgroups
> create mode 100644 tests/vircgroupdata/ovirt-node-6.6.self.cgroup
> create mode 100644 tests/vircgroupdata/ovirt-node-7.1.cgroups
> create mode 100644 tests/vircgroupdata/ovirt-node-7.1.self.cgroup
> create mode 100644 tests/vircgroupdata/rhel-7.1.cgroups
> create mode 100644 tests/vircgroupdata/rhel-7.1.self.cgroup
>
Having the 'struct _detectMountsData' addition separate would make the
diff more relevant.
Reviewed-by: Ján Tomko <jtomko at redhat.com>
Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180924/671fbf7f/attachment-0001.sig>
More information about the libvir-list
mailing list