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.


Clean up compat ioctl handlers in host-dev and keyed-stream host ifaces
[palacios.git] / linux_module / palacios-vnet-ctrl.c
index f0bbac5..12dec1f 100644 (file)
@@ -1,7 +1,8 @@
 /* 
-   Palacios VNET Control Module
-   (c) Lei Xia, 2010
+ * Palacios VNET Control Module
+ * (c) Lei Xia  2010
  */
 #include <linux/spinlock.h>
 #include <linux/seq_file.h>
 #include <linux/proc_fs.h>
@@ -611,7 +612,8 @@ route_write(struct file * file,
        } else if (strnicmp("DEL", token, strlen("DEL")) == 0) {
            char * idx_str = NULL;
            uint32_t d_idx;
-           
+           struct vnet_route_iter * route = NULL;
+
            idx_str = strsep(&buf_iter, " ");
            
            if (!idx_str) {
@@ -621,10 +623,14 @@ route_write(struct file * file,
 
            d_idx = simple_strtoul(idx_str, &idx_str, 10);
 
-           v3_vnet_del_route(d_idx);
-               
-           printk("VNET Control: One route deleted\n");                
+           printk("VNET: deleting route %d\n", d_idx);
 
+           list_for_each_entry(route, &(vnet_ctrl_s.route_list), node) {
+               if (route->idx == d_idx) {
+                   delete_route(route);
+                   break;
+               }
+           }
        } else {
            printk("Invalid Route command string\n");
        }
@@ -650,17 +656,17 @@ static void delete_link(struct vnet_link_iter * link){
 
 
 static void deinit_links_list(void){
-    struct vnet_link_iter * link;
+    struct vnet_link_iter * link, * tmp_link;
 
-    list_for_each_entry(link, &(vnet_ctrl_s.link_iter_list), node) {
+    list_for_each_entry_safe(link, tmp_link, &(vnet_ctrl_s.link_iter_list), node) {
        delete_link(link);
     }
 }
 
 static void deinit_routes_list(void){
-   struct vnet_route_iter * route;
+   struct vnet_route_iter * route, * tmp_route;
 
-   list_for_each_entry(route, &(vnet_ctrl_s.route_list), node) {
+   list_for_each_entry_safe(route, tmp_route, &(vnet_ctrl_s.route_list), node) {
        delete_route(route);
    }
 }