X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fpalacios-vnet.c;h=f13a0a90bb15b109325067ed285711e81fa6449e;hb=ad00932be31579b80f80c1cc67677bd3c263fd89;hp=32f6bd6937891f47b16ef87e127b19f6d1e31ea3;hpb=6ed3385440a7d82f4529bb9433d1a5489351c378;p=palacios.git diff --git a/linux_module/palacios-vnet.c b/linux_module/palacios-vnet.c index 32f6bd6..f13a0a9 100644 --- a/linux_module/palacios-vnet.c +++ b/linux_module/palacios-vnet.c @@ -1,7 +1,8 @@ /* - Palacios VNET Host Hooks Implementations - (c) Lei Xia, 2011 + * Palacios VNET Host Hooks Implementations + * Lei Xia 2010 */ + #include #include #include @@ -9,12 +10,13 @@ #include #include #include -#include #include #include #include -#include "palacios-mm.h" +#include "mm.h" +#include "palacios-vnet.h" +#include "linux-exts.h" static void host_print(const char * fmt, ...) { @@ -276,10 +278,35 @@ static struct vnet_host_hooks vnet_host_hooks = { -int vnet_init( void ) { - printk("Host init VNET\n"); - +static int vnet_init( void ) { init_vnet(&vnet_host_hooks); + + vnet_bridge_init(); + vnet_ctrl_init(); + + INFO("V3 VNET Inited\n"); return 0; } + + +static int vnet_deinit( void ) { + deinit_vnet(); + + vnet_bridge_deinit(); + vnet_ctrl_deinit(); + + INFO("V3 VNET Deinited\n"); + + return 0; +} + +static struct linux_ext vnet_ext = { + .name = "VNET", + .init = vnet_init, + .deinit = vnet_deinit, + .guest_init = NULL, + .guest_deinit = NULL +}; + +register_extension(&vnet_ext);