X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fpalacios-vnet.c;h=2020e487c509ee90b3912166fb321e9ab4929774;hb=18004a8cb830010315b412162da2d92b95a960ee;hp=1584ab1287cdaa2612d0000a14ad3119cffbce76;hpb=b58e6460aa8ea7677a84b838d9c57a728ddaf032;p=palacios.git diff --git a/linux_module/palacios-vnet.c b/linux_module/palacios-vnet.c index 1584ab1..2020e48 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,22 +10,50 @@ #include #include #include -#include #include #include #include -#include "palacios-mm.h" +#include "mm.h" +#include "palacios.h" #include "palacios-vnet.h" +#include "linux-exts.h" static void host_print(const char * fmt, ...) { +#if V3_PRINTK_OLD_STYLE_OUTPUT - va_list ap; - va_start(ap, fmt); - vprintk(fmt, ap); - va_end(ap); + va_list ap; - return; + va_start(ap, fmt); + vprintk(fmt, ap); + va_end(ap); + + return + +#else + + va_list ap; + char *buf; + + // Allocate space atomically, in case we are called + // with a lock held + buf = kmalloc(V3_PRINTK_BUF_SIZE, GFP_ATOMIC); + if (!buf) { + printk("palacios: output skipped - unable to allocate\n"); + return; + } + + va_start(ap, fmt); + vsnprintf(buf,V3_PRINTK_BUF_SIZE, fmt, ap); + va_end(ap); + + printk(KERN_INFO "palacios: %s",buf); + + kfree(buf); + + return; + +#endif } @@ -283,7 +312,7 @@ static int vnet_init( void ) { vnet_bridge_init(); vnet_ctrl_init(); - printk("V3 VNET Inited\n"); + INFO("V3 VNET Inited\n"); return 0; } @@ -295,7 +324,7 @@ static int vnet_deinit( void ) { vnet_bridge_deinit(); vnet_ctrl_deinit(); - printk("V3 VNET Deinited\n"); + INFO("V3 VNET Deinited\n"); return 0; }