Comment 10 for bug 2008102

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/nova/+/882920
Committed: https://opendev.org/openstack/nova/commit/aa295b4ad71b59ba9ba612f07f1f108a8a25473b
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit aa295b4ad71b59ba9ba612f07f1f108a8a25473b
Author: Jorge San Emeterio <email address hidden>
Date: Wed Feb 8 15:33:54 2023 +0100

    Have host look for CPU controller of cgroupsv2 location.

    Make the host class look under '/sys/fs/cgroup/cgroup.controllers' for support of the cpu controller. The host will try searching through cgroupsv1 first, just like up until now, and in the case that fails, it will try cgroupsv2 then. The host will not support the feature if both checks fail.

    This new check needs to be mocked by all tests that focus on this piece of code, as it touches a system file that requires privileges. For such thing, the CGroupsFixture is defined to easily add suck mocking to all test cases that require so.

    I also removed old mocking at test_driver.py in favor of the fixture from above.

    Conflicts:
        nova/tests/unit/virt/libvirt/test_driver.py

    NOTE(auniyal):
    - as new cgroup fixture is added, removed old mocking in few more unit test cases in test_driver
    - did not remove test_guest_cpu_shares_with_multi_vcpu from test_driver

    Partial-Bug: #2008102
    Change-Id: I99b57c27c8a4425389bec2b7f05af660bab85610
    (cherry picked from commit 973ff4fc1a0586937d13f2b39e517422713b1003)
    (cherry picked from commit eb3fe4ddc621380afa32ec9aec0c285f36f99ee3)
    (cherry picked from commit 9e86be5a5365b1896d489de7149e471fd22881d6)