diff options
author | Marko Zec <zec@FreeBSD.org> | 2009-05-31 12:10:04 +0000 |
---|---|---|
committer | Marko Zec <zec@FreeBSD.org> | 2009-05-31 12:10:04 +0000 |
commit | feb08d06b96efe8c04c604de3ad591f103ae83b0 (patch) | |
tree | 6885e54172e0694f4186029864fdc53c37aa9631 /sys/net/if.c | |
parent | 38a18e9760bdfd0d0b56bac1c26e3582f66bb011 (diff) | |
download | src-feb08d06b96efe8c04c604de3ad591f103ae83b0.tar.gz src-feb08d06b96efe8c04c604de3ad591f103ae83b0.zip |
Introduce an interm userland-kernel API for creating vnets and
assigning ifnets from one vnet to another. Deletion of vnets is not
yet supported.
The interface is implemented as an ioctl extension so that no syscalls
had to be introduced. This should be acceptable given that the new
interface will be used for a short / interim period only, until the
new jail management framwork gains the capability of managing vnets.
This method for managing vimages / vnets has been in use for the past
7 years without any observable issues.
The userland tool to be used in conjunction with the interim API can be
found in p4: //depot/projects/vimage-commit2/src/usr.sbin/vimage/... and
will most probably never get commited to svn.
While here, bump copyright notices in kern_vimage.c and vimage.h to
cover work done in year 2009.
Approved by: julian (mentor)
Discussed with: bz, rwatson
Notes
Notes:
svn path=/head/; revision=193166
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 7248768439c1..4d4befc2735d 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2283,6 +2283,21 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) ifr = (struct ifreq *)data; switch (cmd) { +#ifdef VIMAGE + /* + * XXX vnet creation will be implemented through the new jail + * framework - this is just a temporary hack for testing the + * vnet create / destroy mechanisms. + */ + case SIOCSIFVIMAGE: + error = vi_if_move((struct vi_req *) data, NULL, + TD_TO_VIMAGE(td)); + return (error); + case SIOCSPVIMAGE: + case SIOCGPVIMAGE: + error = vi_td_ioctl(cmd, (struct vi_req *) data, td); + return (error); +#endif case SIOCIFCREATE: case SIOCIFCREATE2: error = priv_check(td, PRIV_NET_IFCREATE); |