[PATCH 5/5] Skip detecting placement if controller is disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

If the app has provided a whitelist of controllers to be used,
we skip detecting its mount point. We still, however, fill in
the placement info which later confuses the machine name
validation code. Skip detecting placement if the controller
mount point is not set

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/util/vircgroup.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 3818172..827d894 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -137,8 +137,8 @@ virCgroupValidateMachineGroup(virCgroupPtr group,
 
         if (STRNEQ(tmp, name) &&
             STRNEQ(tmp, partname)) {
-            VIR_DEBUG("Name '%s' does not match '%s' or '%s'",
-                      tmp, name, partname);
+            VIR_DEBUG("Name '%s' for controller '%s' does not match '%s' or '%s'",
+                      tmp, virCgroupControllerTypeToString(i), name, partname);
             goto cleanup;
         }
     }
@@ -426,7 +426,8 @@ static int virCgroupDetectPlacement(virCgroupPtr group,
                  * selfpath=="/libvirt.service" + path="" -> "/libvirt.service"
                  * selfpath=="/libvirt.service" + path="foo" -> "/libvirt.service/foo"
                  */
-                if (typelen == len && STREQLEN(typestr, tmp, len)) {
+                if (typelen == len && STREQLEN(typestr, tmp, len) &&
+                    group->controllers[i].mountPoint != NULL) {
                     if (virAsprintf(&group->controllers[i].placement,
                                     "%s%s%s", selfpath,
                                     (STREQ(selfpath, "/") ||
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]