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.


deallocate arch specific IO/MSR hook state
[palacios.git] / palacios / src / palacios / vmm_socket.c
index c39fb5e..683f6e4 100644 (file)
@@ -207,15 +207,25 @@ uint32_t v3_ntohl(uint32_t n) {
 v3_sock_t v3_create_udp_socket(struct v3_vm_info * vm) {
     V3_ASSERT(sock_hooks);
     V3_ASSERT(sock_hooks->udp_socket);
+    void * priv_data = NULL;
+
+    if (vm) {
+       priv_data = vm->host_priv_data;
+    }
     
-    return sock_hooks->udp_socket(0, 0, vm->host_priv_data);
+    return sock_hooks->udp_socket(0, 0, priv_data);
 }
 
 v3_sock_t v3_create_tcp_socket(struct v3_vm_info * vm) {
     V3_ASSERT(sock_hooks);
     V3_ASSERT(sock_hooks->tcp_socket);
-    
-    return sock_hooks->tcp_socket(0, 1, 0, vm->host_priv_data);
+    void * priv_data = NULL;
+
+    if (vm) {
+       priv_data = vm->host_priv_data;
+    }
+
+    return sock_hooks->tcp_socket(0, 1, 0, priv_data);
 }
 
 void v3_socket_close(v3_sock_t sock) {