[libvirt PATCH 1/2] vircgroupmock: fix cgroup v1 mocking

Pavel Hrdina phrdina at redhat.com
Wed Oct 19 12:13:45 UTC 2022


The `legacy` mode is also valid so we need to take it into account as
well.

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 tests/vircgroupmock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c
index 8a0e3aec0f..777d60b152 100644
--- a/tests/vircgroupmock.c
+++ b/tests/vircgroupmock.c
@@ -317,7 +317,7 @@ static int make_controller(const char *path, mode_t mode)
             unified = true;
         } else if (STREQ(mock, "hybrid")) {
             hybrid = true;
-        } else {
+        } else if (STRNEQ(mock, "legacy")) {
             fprintf(stderr, "invalid mode '%s'\n", mock);
             abort();
         }
@@ -355,7 +355,7 @@ static void init_sysfs(void)
             unified = true;
         } else if (STREQ(mock, "hybrid")) {
             hybrid = true;
-        } else {
+        } else if (STRNEQ(mock, "legacy")) {
             fprintf(stderr, "invalid mode '%s'\n", mock);
             abort();
         }
-- 
2.37.3



More information about the libvir-list mailing list