static int lxcContainerMountCGroups(struct lxcContainerCGroup *mounts,
- size_t nmounts)
+ size_t nmounts,
+ char * sec_mount_options)
{
size_t i;
+ char *opts = NULL;
VIR_DEBUG("Mounting cgroups at '%s'", VIR_CGROUP_SYSFS_MOUNT);
return -1;
}
- if (mount("tmpfs", VIR_CGROUP_SYSFS_MOUNT, "tmpfs", MS_NOSUID|MS_NODEV|MS_NOEXEC, "mode=755") < 0) {
+ if (virAsprintf(&opts,
+ "mode=755,size=65536%s",(sec_mount_options ? sec_mount_options : "")) < 0 ) {
+ virReportOOMError();
+ return -1;
+ }
+
+ if (mount("tmpfs", VIR_CGROUP_SYSFS_MOUNT, "tmpfs", MS_NOSUID|MS_NODEV|MS_NOEXEC, opts) < 0) {
+ VIR_FREE(opts);
virReportSystemError(errno,
_("Failed to mount %s on %s type %s"),
"tmpfs", VIR_CGROUP_SYSFS_MOUNT, "tmpfs");
return -1;
}
+ VIR_FREE(opts);
for (i = 0 ; i < nmounts ; i++) {
if (mounts[i].linkDest) {
/* Now we can re-mount the cgroups controllers in the
* same configuration as before */
- if (lxcContainerMountCGroups(mounts, nmounts) < 0)
+ if (lxcContainerMountCGroups(mounts, nmounts, sec_mount_options) < 0)
goto cleanup;
/* Mounts /dev/pts */
/* Now we can re-mount the cgroups controllers in the
* same configuration as before */
- if (lxcContainerMountCGroups(mounts, nmounts) < 0)
+ if (lxcContainerMountCGroups(mounts, nmounts, sec_mount_options) < 0)
goto cleanup;
VIR_DEBUG("Mounting completed");