diff options
author | bz <bz@FreeBSD.org> | 2008-08-17 23:27:27 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2008-08-17 23:27:27 +0000 |
commit | 1021d43b569bfc8d2c5544bde2f540fa432b011f (patch) | |
tree | 1496da534aec03cf2f9d2d0735d80e4c1e3b5715 /sys/compat | |
parent | 7fc341305a3e341fca7f202fc1219358f8d9dbbd (diff) | |
download | FreeBSD-src-1021d43b569bfc8d2c5544bde2f540fa432b011f.zip FreeBSD-src-1021d43b569bfc8d2c5544bde2f540fa432b011f.tar.gz |
Commit step 1 of the vimage project, (network stack)
virtualization work done by Marko Zec (zec@).
This is the first in a series of commits over the course
of the next few weeks.
Mark all uses of global variables to be virtualized
with a V_ prefix.
Use macros to map them back to their global names for
now, so this is a NOP change only.
We hope to have caught at least 85-90% of what is needed
so we do not invalidate a lot of outstanding patches again.
Obtained from: //depot/projects/vimage-commit2/...
Reviewed by: brooks, des, ed, mav, julian,
jamie, kris, rwatson, zec, ...
(various people I forgot, different versions)
md5 (with a bit of help)
Sponsored by: NLnet Foundation, The FreeBSD Foundation
X-MFC after: never
V_Commit_Message_Reviewed_By: more people than the patch
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 3 | ||||
-rw-r--r-- | sys/compat/linux/linux_ioctl.c | 10 | ||||
-rw-r--r-- | sys/compat/linux/linux_misc.c | 3 | ||||
-rw-r--r-- | sys/compat/linux/linux_socket.c | 3 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_sockio.c | 3 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_stat.c | 5 |
6 files changed, 17 insertions, 10 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index 7d8e2b6..f5055b1 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include <sys/user.h> #include <sys/vmmeter.h> #include <sys/vnode.h> +#include <sys/vimage.h> #include <net/if.h> @@ -1008,7 +1009,7 @@ linprocfs_donetdev(PFS_FILL_ARGS) "bytes packets errs drop fifo frame compressed"); IFNET_RLOCK(); - TAILQ_FOREACH(ifp, &ifnet, if_link) { + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { linux_ifname(ifp, ifname, sizeof ifname); sbuf_printf(sb, "%6.6s:", ifname); sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu ", diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 9364c41..b166535 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include <sys/sx.h> #include <sys/tty.h> #include <sys/uio.h> +#include <sys/vimage.h> + #include <net/if.h> #include <net/if_dl.h> #include <net/if_types.h> @@ -2054,7 +2056,7 @@ linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen) /* Determine the (relative) unit number for ethernet interfaces */ ethno = 0; IFNET_RLOCK(); - TAILQ_FOREACH(ifscan, &ifnet, if_link) { + TAILQ_FOREACH(ifscan, &V_ifnet, if_link) { if (ifscan == ifp) { IFNET_RUNLOCK(); return (snprintf(buffer, buflen, "eth%d", ethno)); @@ -2093,7 +2095,7 @@ ifname_linux_to_bsd(const char *lxname, char *bsdname) index = 0; is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0; IFNET_RLOCK(); - TAILQ_FOREACH(ifp, &ifnet, if_link) { + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { /* * Allow Linux programs to use FreeBSD names. Don't presume * we never have an interface named "eth", so don't make @@ -2137,7 +2139,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) /* handle the 'request buffer size' case */ if (ifc.ifc_buf == PTROUT(NULL)) { ifc.ifc_len = 0; - TAILQ_FOREACH(ifp, &ifnet, if_link) { + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa = ifa->ifa_addr; if (sa->sa_family == AF_INET) @@ -2164,7 +2166,7 @@ again: /* Return all AF_INET addresses of all interfaces */ IFNET_RLOCK(); /* could sleep XXX */ - TAILQ_FOREACH(ifp, &ifnet, if_link) { + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { int addrs = 0; bzero(&ifr, sizeof(ifr)); diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 57d315f..8a983cb 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include <sys/vnode.h> #include <sys/wait.h> #include <sys/cpuset.h> +#include <sys/vimage.h> #include <security/mac/mac_framework.h> @@ -765,7 +766,7 @@ linux_newuname(struct thread *td, struct linux_newuname_args *args) strlcpy(utsname.machine, machine, LINUX_MAX_UTSNAME); #endif /* __i386__ */ mtx_lock(&hostname_mtx); - strlcpy(utsname.domainname, domainname, LINUX_MAX_UTSNAME); + strlcpy(utsname.domainname, V_domainname, LINUX_MAX_UTSNAME); mtx_unlock(&hostname_mtx); return (copyout(&utsname, args->buf, sizeof(utsname))); diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index e6ac278..09e88bb 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include <sys/uio.h> #include <sys/syslog.h> #include <sys/un.h> +#include <sys/vimage.h> #include <netinet/in.h> #include <netinet/in_systm.h> @@ -588,7 +589,7 @@ linux_socket(struct thread *td, struct linux_socket_args *args) * XXX: Avoid undefined symbol error with an IPv4 only * kernel. */ - && ip6_v6only + && V_ip6_v6only #endif ) { int v6only; diff --git a/sys/compat/svr4/svr4_sockio.c b/sys/compat/svr4/svr4_sockio.c index 7fd2885..41a1621 100644 --- a/sys/compat/svr4/svr4_sockio.c +++ b/sys/compat/svr4/svr4_sockio.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/filedesc.h> #include <sys/sockio.h> #include <sys/socket.h> +#include <sys/vimage.h> #include <net/if.h> @@ -103,7 +104,7 @@ svr4_sock_ioctl(fp, td, retval, fd, cmd, data) * entry per physical interface? */ IFNET_RLOCK(); - TAILQ_FOREACH(ifp, &ifnet, if_link) + TAILQ_FOREACH(ifp, &V_ifnet, if_link) if (TAILQ_EMPTY(&ifp->if_addrhead)) ifnum++; else diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c index 7b6f200..3492aa8 100644 --- a/sys/compat/svr4/svr4_stat.c +++ b/sys/compat/svr4/svr4_stat.c @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include <sys/sysctl.h> #include <sys/sysproto.h> #include <sys/un.h> +#include <sys/vimage.h> #include <vm/vm.h> @@ -426,7 +427,7 @@ svr4_sys_systeminfo(td, uap) break; case SVR4_SI_HOSTNAME: - str = hostname; + str = V_hostname; break; case SVR4_SI_RELEASE: @@ -455,7 +456,7 @@ svr4_sys_systeminfo(td, uap) case SVR4_SI_SRPC_DOMAIN: /* XXXRW: locking? */ - str = domainname; + str = V_domainname; break; case SVR4_SI_PLATFORM: |