]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Skip detecting placement if controller is disabled
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 25 Jul 2013 12:12:30 +0000 (13:12 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 25 Jul 2013 18:55:51 +0000 (19:55 +0100)
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@redhat.com>
src/util/vircgroup.c

index a0229bf4a825f38d367f3dad6f4aad34bdce6b22..68ec9539fd7a8ab2a818465c2dc5991a80bb8d8e 100644 (file)
@@ -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, "/") ||