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.


Actually do cleanup in guest deinit in stream iface
Kyle Hale [Sat, 7 Jul 2012 22:41:28 +0000 (17:41 -0500)]
linux_module/iface-stream.c

index 62631fe..b95b1d3 100644 (file)
@@ -300,9 +300,13 @@ static int stream_init( void ) {
 
 
 static int stream_deinit( void ) {
-    if (!list_empty(&(global_streams))) {
-       ERROR("Error removing module with open streams\n");
-       DEBUG("TODO: free old streams... \n");
+    struct stream_state * stream = NULL;
+    struct stream_state * tmp = NULL;
+
+    list_for_each_entry_safe(stream, tmp, &(global_streams), stream_node) {
+        free_ringbuf(stream->out_ring);
+        list_del(&(stream->stream_node));
+        palacios_free(stream);
     }
 
     return 0;
@@ -379,11 +383,18 @@ static int guest_stream_init(struct v3_guest * guest, void ** vm_data) {
 
 static int guest_stream_deinit(struct v3_guest * guest, void * vm_data) {
     struct vm_global_streams * state = vm_data;
-    if (!list_empty(&(state->open_streams))) {
-       ERROR("Error shutting down VM with open streams\n");
-       return -1;
-    }
 
+    struct stream_state * stream = NULL;
+    struct stream_state * tmp = NULL;
+
+    list_for_each_entry_safe(stream, tmp, &(global_streams), stream_node) {
+        free_ringbuf(stream->out_ring);
+        list_del(&(stream->stream_node));
+        palacios_free(stream);
+    }
+    
+    palacios_free(state);
+    
     return 0;
 }