]> xenbits.xensource.com Git - libvirt.git/commitdiff
vircgroupmock: fix cgroup v1 mocking
authorPavel Hrdina <phrdina@redhat.com>
Wed, 19 Oct 2022 11:54:18 +0000 (13:54 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 19 Oct 2022 14:32:14 +0000 (16:32 +0200)
The `legacy` mode is also valid so we need to take it into account as
well.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/vircgroupmock.c

index 8a0e3aec0f3fb576dead59d9867513414af9201a..777d60b1520677a67df4a430b772c678ed8c6b1f 100644 (file)
@@ -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();
         }