Krishna iResearch Intelligent Cloud Platform - VIRtual Generic Os - VIRGO - Linux kernel extensions for cloud
 All Classes
virgocloudexecsvc.h
1 /***************************************************************************************
2 VIRGO - a linux module extension with CPU and Memory pooling with cloud capabilities
3 
4 Copyright (C) 2009-2013 Ka.Shrinivaasan
5 
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 --------------------------------------------------------------------------------------------------
20 Srinivasan Kannan (alias) Ka.Shrinivaasan (alias) Shrinivas Kannan
21 Independent Open Source Developer, Researcher and Consultant
22 Ph: 9003082186, 9791165980
23 Open Source Products Profile(Krishna iResearch): http://sourceforge.net/users/ka_shrinivaasan
24 Personal website(research): https://sites.google.com/site/kuja27/
25 emails: ka.shrinivaasan@gmail.com, shrinivas.kannan@gmail.com, kashrinivaasan@live.com
26 --------------------------------------------------------------------------------------------------
27 
28 *****************************************************************************************/
29 
30 #ifndef _LINUX_VIRGOCLOUDEXECSVC_H
31 #define _LINUX_VIRGOCLOUDEXECSVC_H
32 
33 #include <linux/virgo.h>
34 #include <linux/socket.h>
35 
36 
37 int virgo_cloudexec_service(void* args)
38 {
39 
40  try_module_get(virgo_class.m_virgo_owner);
41  while(1)
42  {
43  printk(KERN_INFO "virgo_cloudexec_service(): virgo_ops.virgo_create() \n");
44  struct socket* clsock = virgo_ops.virgo_create();
45 
46  /*
47  Multithreaded VIRGO Kernel Service
48  ----------------------------------
49  */
50 
51 
52  struct task_struct *task;
53  void* args=clsock;
54  int woken_up=0;
55  printk(KERN_INFO "virgo_cloudexec_service(): virgo client thread per request \n");
56  task=kthread_create(virgo_client_thread, (void*)args, "virgo client thread per virgo_clone request");
57  woken_up=wake_up_process(task);
58 
59  /*
60  virgo_ops.virgo_recvfrom();
61  virgo_ops.virgo_sendto();
62  */
63  }
64 
65 }
66 
67 /*
68 Multithreaded VIRGO Kernel Service
69 ----------------------------------
70 */
71 
72 int virgo_client_thread(void* args)
73 {
74  struct socket* clientsock=(struct socket*)args;
75  printk(KERN_INFO "virgo_client_thread(): virgo_ops.virgo_recvfrom()\n");
76  virgo_ops.virgo_recvfrom(clientsock);
77  printk(KERN_INFO "virgo_client_thread(): virgo_ops.virgo_sendto()\n");
78  virgo_ops.virgo_sendto(clientsock);
79 }
80 
81 #endif