[libvirt] [PATCH 3/7] Make cgroups a little more efficient

Daniel P. Berrange berrange at redhat.com
Mon Jul 20 10:44:44 UTC 2009


On Fri, Jul 17, 2009 at 04:28:51PM +0200, Daniel Veillard wrote:
> On Fri, Jul 17, 2009 at 09:04:25AM -0400, Daniel P. Berrange wrote:
> >  
> >      mounts = fopen("/proc/mounts", "r");
> >      if (mounts == NULL) {
> > -        DEBUG0("Unable to open /proc/mounts: %m");
> > -        goto err;
> > +        VIR_ERROR0("Unable to open /proc/mounts");
> > +        return -ENOENT;
> >      }
> >  
> >      while (getmntent_r(mounts, &entry, buf, sizeof(buf)) != NULL) {
> > -        if (STREQ(entry.mnt_type, "cgroup") &&
> > -            (strstr(entry.mnt_opts, controller))) {
> > -            root->path = strdup(entry.mnt_dir);
> > -            break;
> > -        }
> > -    }
> > -
> > -    DEBUG("Mount for %s is %s\n", controller, root->path);
> 
>   Hum, we should keep that debug output in some ways, and report if not
> found either.


You missed the code later on which does this :-)

+            if (!group->controllers[i].placement) {
+                VIR_ERROR("Could not find placement for controller %s at %s",
+                          virCgroupControllerTypeToString(i),
+                          group->controllers[i].placement);
+                rc = -ENOENT;
+                break;
+            }
+            VIR_DEBUG("Detected mount/mapping %i:%s at %s in %s", i,
+                      virCgroupControllerTypeToString(i),
+                      group->controllers[i].mountPoint,
+                      group->controllers[i].placement);



Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list