#include <linux/sched.h>
#include <linux/vs_context.h>
#include <linux/vs_network.h>
#include <linux/vserver/legacy.h>
#include <linux/sched.h>
#include <linux/vs_context.h>
#include <linux/vs_network.h>
#include <linux/vserver/legacy.h>
- new_vxi->vx_flags &= ~(VXF_STATE_SETUP|VXF_STATE_INIT);
+ ret = vx_migrate_task(current, new_vxi,
+ vx_info_flags(new_vxi, VXF_STATE_SETUP, 0));
+ new_vxi->vx_flags &= ~VXF_STATE_SETUP;
if (ret == 0) {
current->vx_info->vx_bcaps &= (~vc_data.remove_cap);
new_vxi->vx_flags |= vc_data.flags;
if (vc_data.flags & VX_INFO_INIT)
vx_set_initpid(new_vxi, current->tgid);
if (vc_data.flags & VX_INFO_NAMESPACE)
if (ret == 0) {
current->vx_info->vx_bcaps &= (~vc_data.remove_cap);
new_vxi->vx_flags |= vc_data.flags;
if (vc_data.flags & VX_INFO_INIT)
vx_set_initpid(new_vxi, current->tgid);
if (vc_data.flags & VX_INFO_NAMESPACE)
- vx_set_namespace(new_vxi,
- current->namespace, current->fs);
+ vx_set_space(new_vxi, CLONE_NEWNS|CLONE_FS);
- new_vxi->limit.rlim[RLIMIT_NPROC] =
- current->signal->rlim[RLIMIT_NPROC].rlim_max;
+ __rlim_set(&new_vxi->limit, RLIMIT_NPROC,
+ current->signal->rlim[RLIMIT_NPROC].rlim_max);
+
+ /* tweak some defaults for legacy */
+ new_vxi->vx_flags |= (VXF_HIDE_NETIF|VXF_INFO_INIT);