Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


More clean on VNET codes
[palacios.git] / palacios / include / palacios / vmm_dev_mgr.h
index 7e4708f..d6942c0 100644 (file)
@@ -62,6 +62,9 @@ struct vmm_dev_mgr {
     struct list_head net_list;
     struct hashtable * net_table;
 
+    struct list_head char_list;
+    struct hashtable * char_table;
+
     struct list_head console_list;
     struct hashtable * console_table;
 
@@ -158,15 +161,35 @@ struct v3_dev_blk_ops {
 };
 
 struct v3_dev_net_ops {
+    /* Backend implemented functions */
     int (*send)(uint8_t * buf, uint32_t count, void * private_data, struct vm_device *dest_dev);
-    int (*receive)(uint8_t * buf, uint32_t count, void * private_data, struct vm_device *src_dev);
+    void (*start_rx)(void *back_data);
+    void (*stop_rx)(void *back_data);
+
+    /* Frontend implemented functions */
+    int (*recv)(uint8_t * buf, uint32_t count, void * frnt_data);
+    void (*poll)(struct v3_vm_info * vm, void * frnt_data);
+    void (*start_tx)(void * frnt_data);
+    void (*stop_tx)(void * frnt_data);
 
+    /* This is ugly... */
+    void * frontend_data; 
 };
 
 struct v3_dev_console_ops {
 
 };
 
+struct v3_dev_char_ops {
+    /* Backend implemented functions */
+    int (*write)(uint8_t * buf, uint64_t len, void * private_data);
+    //  int (*read)(uint8_t * buf, uint64_t len, void * private_data);
+
+    /* Frontend Implemented functions */
+    int (*push)(struct v3_vm_info * vm, uint8_t * buf, uint64_t len, void * private_data);
+};
+
+
 int v3_dev_add_blk_frontend(struct v3_vm_info * vm, 
                            char * name, 
                            int (*connect)(struct v3_vm_info * vm, 
@@ -175,6 +198,7 @@ int v3_dev_add_blk_frontend(struct v3_vm_info * vm,
                                            v3_cfg_tree_t * cfg, 
                                            void * private_data), 
                            void * priv_data);
+
 int v3_dev_connect_blk(struct v3_vm_info * vm, 
                       char * frontend_name, 
                       struct v3_dev_blk_ops * ops, 
@@ -197,6 +221,24 @@ int v3_dev_connect_net(struct v3_vm_info * vm,
                       void * private_data);
 
 
+int v3_dev_add_char_frontend(struct v3_vm_info * vm, 
+                            char * name, 
+                            int (*connect)(struct v3_vm_info * vm, 
+                                           void * frontend_data, 
+                                           struct v3_dev_char_ops * ops, 
+                                           v3_cfg_tree_t * cfg, 
+                                           void * private_data,
+                                           void ** push_fn_arg), 
+                            void * priv_data);
+
+int v3_dev_connect_char(struct v3_vm_info * vm, 
+                       char * frontend_name, 
+                       struct v3_dev_char_ops * ops, 
+                       v3_cfg_tree_t * cfg, 
+                       void * private_data, 
+                       void ** push_fn_arg);
+
+
 #endif // ! __V3VEE__
 
 #endif