route->idx = v3_vnet_add_route(route->route);
- spin_lock_irqsave(&(vnet_ctrl_s.lock), flags);
+ palacios_spinlock_lock_irqsave(&(vnet_ctrl_s.lock), flags);
list_add(&(route->node), &(vnet_ctrl_s.route_list));
vnet_ctrl_s.num_routes ++;
- spin_unlock_irqrestore(&(vnet_ctrl_s.lock), flags);
+ palacios_spinlock_unlock_irqrestore(&(vnet_ctrl_s.lock), flags);
INFO("VNET Control: One route added to VNET core\n");
v3_vnet_del_route(route->idx);
- spin_lock_irqsave(&(vnet_ctrl_s.lock), flags);
+ palacios_spinlock_lock_irqsave(&(vnet_ctrl_s.lock), flags);
list_del(&(route->node));
vnet_ctrl_s.num_routes --;
- spin_unlock_irqrestore(&(vnet_ctrl_s.lock), flags);
+ palacios_spinlock_unlock_irqrestore(&(vnet_ctrl_s.lock), flags);
INFO("VNET Control: Route %d deleted from VNET\n", route->idx);
vnet_brg_delete_link(link->idx);
- spin_lock_irqsave(&(vnet_ctrl_s.lock), flags);
+ palacios_spinlock_lock_irqsave(&(vnet_ctrl_s.lock), flags);
list_del(&(link->node));
vnet_ctrl_s.num_links --;
- spin_unlock_irqrestore(&(vnet_ctrl_s.lock), flags);
+ palacios_spinlock_unlock_irqrestore(&(vnet_ctrl_s.lock), flags);
palacios_free(link);
link = NULL;
link->proto = d_proto;
link->idx = link_idx;
- spin_lock_irqsave(&(vnet_ctrl_s.lock), flags);
+ palacios_spinlock_lock_irqsave(&(vnet_ctrl_s.lock), flags);
list_add(&(link->node), &(vnet_ctrl_s.link_iter_list));
vnet_ctrl_s.num_links ++;
- spin_unlock_irqrestore(&(vnet_ctrl_s.lock), flags);
+ palacios_spinlock_unlock_irqrestore(&(vnet_ctrl_s.lock), flags);
} else if (strnicmp("DEL", token, strlen("DEL")) == 0) {
char * idx_str = NULL;
uint32_t d_idx;
return -1;
}
- route_entry = create_proc_entry("routes", 0, vnet_root);
+ route_entry = create_proc_entry("routes", 0644, vnet_root);
if (route_entry == NULL) {
remove_proc_entry("vnet", NULL);
return -1;
route_entry->proc_fops = &route_fops;
- link_entry = create_proc_entry("links", 0, vnet_root);
+ link_entry = create_proc_entry("links", 0644, vnet_root);
if (link_entry == NULL) {
remove_proc_entry("routes", vnet_root);
remove_proc_entry("vnet", NULL);
link_entry->proc_fops = &link_fops;
- stat_entry = create_proc_entry("stats", 0, vnet_root);
+ stat_entry = create_proc_entry("stats", 0644, vnet_root);
if(stat_entry == NULL) {
remove_proc_entry("links", vnet_root);
remove_proc_entry("routes", vnet_root);
stat_entry->proc_fops = &stat_fops;
- debug_entry = create_proc_entry("debug", 0, vnet_root);
+ debug_entry = create_proc_entry("debug", 0644, vnet_root);
if(debug_entry == NULL) {
remove_proc_entry("links", vnet_root);
remove_proc_entry("routes", vnet_root);
remove_proc_entry("links", vnet_root);
remove_proc_entry("routes", vnet_root);
remove_proc_entry("stats", vnet_root);
- remove_proc_entry("vnet", NULL);
+ remove_proc_entry("vnet", palacios_get_procdir());
}
INIT_LIST_HEAD(&(vnet_ctrl_s.link_iter_list));
INIT_LIST_HEAD(&(vnet_ctrl_s.route_list));
- spin_lock_init(&(vnet_ctrl_s.lock));
+ palacios_spinlock_init(&(vnet_ctrl_s.lock));
init_proc_files();
vnet_ctrl_s.status = 0;
+ palacios_spinlock_deinit(&(vnet_ctrl_s.lock));
+
INFO("VNET Control Deinit Finished\n");
}