+ @classmethod
+ def _InstanceLogFile(cls, instance_name):
+ """Return the log file for an instance.
+
+ """
+ return utils.PathJoin(cls._ROOT_DIR, instance_name + ".log")
+
+ @classmethod
+ def _GetCgroupMountPoint(cls):
+ for _, mountpoint, fstype, _ in utils.GetMounts():
+ if fstype == "cgroup":
+ return mountpoint
+ raise errors.HypervisorError("The cgroup filesystem is not mounted")
+
+ @classmethod
+ def _GetCgroupCpuList(cls, instance_name):
+ """Return the list of CPU ids for an instance.
+
+ """
+ cgroup = cls._GetCgroupMountPoint()
+ try:
+ cpus = utils.ReadFile(utils.PathJoin(cgroup,
+ instance_name,
+ "cpuset.cpus"))
+ except EnvironmentError, err:
+ raise errors.HypervisorError("Getting CPU list for instance"
+ " %s failed: %s" % (instance_name, err))
+
+ return utils.ParseCpuMask(cpus)
+