From: Peter Dinda Date: Fri, 4 Oct 2013 15:18:03 +0000 (-0500) Subject: VNET memory interface and deinit cleanup X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=310d9000bf6012dffd877c3c42e82521b94402c4;p=palacios.git VNET memory interface and deinit cleanup --- diff --git a/linux_module/palacios-vnet.c b/linux_module/palacios-vnet.c index 077eeda..4b23772 100644 --- a/linux_module/palacios-vnet.c +++ b/linux_module/palacios-vnet.c @@ -140,10 +140,10 @@ host_del_timer(void * vnet_timer){ static void * -host_allocate_pages(int num_pages, unsigned int alignment) +host_allocate_pages(int num_pages, unsigned int alignment, int node_id, int constraint) { // allocates pages preferentially on the caller's node - return palacios_allocate_pages(num_pages, alignment, -1); + return palacios_allocate_pages(num_pages, alignment, node_id, constraint); } diff --git a/palacios/include/vnet/vnet_host.h b/palacios/include/vnet/vnet_host.h index 9ab151d..548a252 100644 --- a/palacios/include/vnet/vnet_host.h +++ b/palacios/include/vnet/vnet_host.h @@ -61,7 +61,7 @@ struct vnet_host_hooks { void (*print)(void *vm , int core, const char * format, ...) __attribute__ ((format (printf, 3, 4))); - void *(*allocate_pages)(int num_pages, unsigned int alignment); + void *(*allocate_pages)(int num_pages, unsigned int alignment, int node_id, int constraints); void (*free_pages)(void * page, int num_pages); void *(*malloc)(unsigned int size); diff --git a/palacios/src/devices/lnx_virtio_nic.c b/palacios/src/devices/lnx_virtio_nic.c index 7ead43d..636d8a5 100644 --- a/palacios/src/devices/lnx_virtio_nic.c +++ b/palacios/src/devices/lnx_virtio_nic.c @@ -198,6 +198,11 @@ static int virtio_deinit_state(struct guest_info *core, struct virtio_net_state if (ns->timer) { v3_remove_timer(core,ns->timer); } + + v3_lock_deinit(&(ns->rx_lock)); + v3_lock_deinit(&(ns->tx_lock)); + + return 0; } @@ -753,9 +758,6 @@ static int virtio_free(struct virtio_dev_state * virtio) { V3_Free(backend); } - v3_lock_deinit(&(virtio->rx_lock)); - v3_lock_deinit(&(virtio->tx_lock)); - V3_Free(virtio); return 0;