PERFORCE change 163248 for review
Marko Zec
zec at FreeBSD.org
Mon Jun 1 11:00:08 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=163248
Change 163248 by zec at zec_amdx4 on 2009/06/01 10:59:26
De-staticize vimage_by_name() as in vimage branch this is
needed by various #ifdef IMUNES_HACK things. Also resurrect
V_morphing_symlinks which IMUNES needs badly.
Fix misintegrations / relicts from old times in if_ethersubr.c
Affected files ...
.. //depot/projects/vimage/src/sys/kern/kern_vimage.c#94 edit
.. //depot/projects/vimage/src/sys/net/if_ethersubr.c#41 edit
.. //depot/projects/vimage/src/sys/sys/vimage.h#97 edit
Differences ...
==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#94 (text+ko) ====
@@ -65,7 +65,6 @@
static int vnet_mod_destructor(struct vnet_modlink *);
#ifdef VIMAGE
-static struct vimage *vimage_by_name(struct vimage *, char *);
static struct vimage *vi_alloc(struct vimage *, char *);
static int vi_destroy(struct vimage *);
static struct vimage *vimage_get_next(struct vimage *, struct vimage *, int);
@@ -280,7 +279,7 @@
return (0);
}
-static struct vimage *
+struct vimage *
vimage_by_name(struct vimage *top, char *name)
{
struct vimage *vip;
==== //depot/projects/vimage/src/sys/net/if_ethersubr.c#41 (text+ko) ====
@@ -924,25 +924,6 @@
return (etherbuf);
}
-#ifdef VIMAGE
-static void
-ether_reassign(struct ifnet *ifp, struct vnet *vnet, char *dname)
-{
- u_char eaddr[6];
-
- bcopy(IF_LLADDR(ifp), eaddr, 6);
- ether_ifdetach(ifp);
- ifp->if_bpf = NULL;
- if_reassign_common(ifp, vnet, "eth");
- if (dname)
- snprintf(ifp->if_xname, IFNAMSIZ, "%s", dname);
-
- CURVNET_SET_QUIET(vnet);
- ether_ifattach(ifp, eaddr);
- CURVNET_RESTORE();
-}
-#endif
-
/*
* Perform common duties while attaching to interface list
*/
@@ -952,9 +933,6 @@
int i;
struct ifaddr *ifa;
struct sockaddr_dl *sdl;
-#ifdef VIMAGE
- struct vnet *home_vnet_0 = ifp->if_home_vnet;
-#endif
ifp->if_addrlen = ETHER_ADDR_LEN;
ifp->if_hdrlen = ETHER_HDR_LEN;
@@ -963,9 +941,6 @@
ifp->if_output = ether_output;
ifp->if_input = ether_input;
ifp->if_resolvemulti = ether_resolvemulti;
-#ifdef VIMAGE
- ifp->if_reassign = ether_reassign;
-#endif
if (ifp->if_baudrate == 0)
ifp->if_baudrate = IF_Mbps(10); /* just a default */
ifp->if_broadcastaddr = etherbroadcastaddr;
@@ -985,11 +960,7 @@
for (i = 0; i < ifp->if_addrlen; i++)
if (lla[i] != 0)
break;
-#ifdef VIMAGE
- if (i != ifp->if_addrlen && home_vnet_0 != ifp->if_home_vnet)
-#else
if (i != ifp->if_addrlen)
-#endif
if_printf(ifp, "Ethernet address: %6D\n", lla, ":");
}
==== //depot/projects/vimage/src/sys/sys/vimage.h#97 (text+ko) ====
@@ -159,6 +159,7 @@
int vi_td_ioctl(u_long, struct vi_req *, struct thread *);
int vi_if_move(struct vi_req *, struct ifnet *, struct vimage *);
int vi_child_of(struct vimage *, struct vimage *);
+struct vimage *vimage_by_name(struct vimage *, char *);
void vnet_mod_register(const struct vnet_modinfo *);
void vnet_mod_register_multi(const struct vnet_modinfo *, void *, char *);
void vnet_mod_deregister(const struct vnet_modinfo *);
@@ -217,6 +218,7 @@
LIST_ENTRY(vprocg) vprocg_le;
u_int vprocg_id; /* ID num */
u_int nprocs;
+ int _morphing_symlinks;
};
#ifdef VIMAGE
@@ -352,6 +354,8 @@
/* XXX those defines bellow should probably go into vprocg.h and vcpu.h */
#define VPROCG(sym) VSYM(vprocg, sym)
+#define V_morphing_symlinks VPROCG(morphing_symlinks)
+
/*
* Size-guards for the vimage structures.
* If you need to update the values you MUST increment __FreeBSD_version.
More information about the p4-projects
mailing list