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.


Modify Socket, Make V3_SOCK long
Lei Xia [Tue, 10 Feb 2009 03:08:36 +0000 (21:08 -0600)]
palacios/include/palacios/vmm_socket.h
palacios/src/palacios/vmm_socket.c

index f73830e..eb87f71 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <palacios/vmm.h>
 
-#define V3_SOCK void *
+#define V3_SOCK long
 
 #ifdef __V3VEE__
 
@@ -254,5 +254,4 @@ struct v3_socket_hooks {
 
 extern void V3_Init_Sockets(struct v3_socket_hooks * hooks);
 
-
 #endif
index 57ee546..c4736dd 100644 (file)
@@ -27,7 +27,7 @@
 struct v3_socket_hooks * sock_hooks = 0;
 
 
-//static int v3_socket_api_test(void);
+//int v3_socket_api_test(void);
 
 
 void V3_Init_Sockets(struct v3_socket_hooks * hooks) {
@@ -119,7 +119,8 @@ void v3_zero_sockset(struct v3_sock_set * sock_set) {
 }
 
 #if 0
-static int
+
+int
 v3_socket_api_test(void)
 {
        unsigned int port;
@@ -131,7 +132,7 @@ v3_socket_api_test(void)
        
        PrintDebug("\nIn Palacios: Test V3_Socket Macros\n");
        sock = V3_Create_TCP_Socket();
-       if( sock == NULL ){
+       if( ((int)sock) < 0 ){
                PrintDebug( "ERROR: tcp_socket() failed!\n");
                return -1;
        }
@@ -150,7 +151,7 @@ v3_socket_api_test(void)
 
        PrintDebug( "Going into mainloop: server listening on port %d\n", port);
 
-       client = V3_Accept_Socket(sock, &remote_ip , &port);
+       client = V3_Accept_Socket(sock, &remote_ip, &port);
 
        PrintDebug(" New connection from %d port: %d\n", remote_ip, port);
             
@@ -159,7 +160,7 @@ v3_socket_api_test(void)
        while(1)
        {               
             V3_Send(client, buf, rc);
-            rc = V3_Recv(client, buf, sizeof(buf)-1);
+             rc = V3_Recv(client, buf, sizeof(buf)-1);
             if( rc <= 0 ){
                                PrintDebug( "Closed connection\n");
                                V3_Close_Socket(client);
@@ -177,6 +178,7 @@ v3_socket_api_test(void)
 
 #endif
 
+
 #if 0
 
 static int