From: Lei Xia Date: Tue, 14 Jun 2011 03:39:23 +0000 (-0500) Subject: Merge branch 'devel' of palacios@newskysaw.cs.northwestern.edu:/home/palacios/palacio... X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3ae2e84abc3814fb89baedebeaa5ac215fec89f;hp=c1c2c17d6e7655447a16345089b1da7fa5819b6c;p=palacios.git Merge branch 'devel' of palacios@newskysaw.cs.northwestern.edu:/home/palacios/palacios into devel --- diff --git a/linux_module/palacios-vnet-ctrl.c b/linux_module/palacios-vnet-ctrl.c index f0bbac5..4cd1c15 100644 --- a/linux_module/palacios-vnet-ctrl.c +++ b/linux_module/palacios-vnet-ctrl.c @@ -611,7 +611,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 +622,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"); } diff --git a/palacios/src/vnet/vnet_core.c b/palacios/src/vnet/vnet_core.c index 3a1ad38..b82c905 100644 --- a/palacios/src/vnet/vnet_core.c +++ b/palacios/src/vnet/vnet_core.c @@ -147,10 +147,9 @@ static void print_route(struct v3_vnet_route * route){ static void dump_routes(){ struct vnet_route_info *route; - int i = 0; Vnet_Debug("\n========Dump routes starts ============\n"); list_for_each_entry(route, &(vnet_state.routes), node) { - Vnet_Debug("\nroute %d:\n", i++); + Vnet_Debug("\nroute %d:\n", route->idx); print_route(&(route->route_def)); if (route->route_def.dst_type == LINK_INTERFACE) { @@ -302,14 +301,20 @@ void v3_vnet_del_route(uint32_t route_idx){ flags = vnet_lock_irqsave(vnet_state.lock); list_for_each_entry(route, &(vnet_state.routes), node) { + V3_Print("v3_vnet_del_route, route idx: %d\n", route->idx); if(route->idx == route_idx){ list_del(&(route->node)); - list_del(&(route->match_node)); - Vnet_Free(route); + Vnet_Free(route); + break; } } vnet_unlock_irqrestore(vnet_state.lock, flags); + clear_hash_cache(); + +#ifdef V3_CONFIG_DEBUG_VNET + dump_routes(); +#endif }