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.


format fix
Lei Xia [Thu, 5 May 2011 22:31:19 +0000 (17:31 -0500)]
palacios/include/vnet/vnet.h
palacios/include/vnet/vnet_host.h
palacios/src/vnet/vnet_core.c
palacios/src/vnet/vnet_hashtable.c
palacios/src/vnet/vnet_host.c

index 0776972..710ad9d 100644 (file)
@@ -86,19 +86,19 @@ struct vnet_stat{
 
 struct v3_vnet_bridge_ops {
     int (*input)(struct v3_vm_info * vm, 
-               struct v3_vnet_pkt * pkt,
-               void * private_data);
+                struct v3_vnet_pkt * pkt,
+                void * private_data);
     void (*poll)(struct v3_vm_info * vm,  
-               void * private_data);
+                void * private_data);
 };
 
 #define HOST_LNX_BRIDGE 1
 #define CTL_VM_BRIDGE  2
 
 int v3_vnet_add_bridge(struct v3_vm_info * vm,
-               struct v3_vnet_bridge_ops * ops,
-               uint8_t type,
-               void * priv_data);
+                      struct v3_vnet_bridge_ops * ops,
+                      uint8_t type,
+                      void * priv_data);
 int v3_vnet_add_route(struct v3_vnet_route route);
 int v3_vnet_send_pkt(struct v3_vnet_pkt * pkt, void * private_data, int synchronize);
 int v3_vnet_find_dev(uint8_t  * mac);
@@ -108,8 +108,8 @@ int v3_vnet_stat(struct vnet_stat * stats);
 
 struct v3_vnet_dev_ops {
     int (*input)(struct v3_vm_info * vm, 
-               struct v3_vnet_pkt * pkt, 
-               void * dev_data);
+                struct v3_vnet_pkt * pkt, 
+                void * dev_data);
 };
 
 int v3_init_vnet(void);        
index 616d7b6..47f6481 100644 (file)
@@ -131,7 +131,8 @@ static inline void Vnet_Yield(){
 }
 
 /* THREAD FUNCTIONS */
-struct vnet_thread * vnet_start_thread(int (*func)(void *), void *arg, char * name);
+struct vnet_thread * vnet_start_thread(int (*func)(void *), 
+                                      void *arg, char * name);
 
 static inline void vnet_thread_sleep(long timeout){
     if((host_hooks) && host_hooks->thread_sleep){
@@ -168,7 +169,9 @@ static inline void  vnet_udelay(unsigned long usecs){
 
 /* TIMER FUNCTIONS */
 /* interval, in jittes */
-struct vnet_timer * vnet_create_timer(unsigned long interval, void (* timer_fun)(void * priv_data), void * pri_data);
+struct vnet_timer * vnet_create_timer(unsigned long interval, 
+                                     void (* timer_fun)(void * priv_data), 
+                                     void * pri_data);
 
 static inline void vnet_del_timer(struct vnet_timer * timer){
     if((host_hooks) && host_hooks->timer_del){
@@ -202,28 +205,27 @@ static inline void vnet_reset_timer(struct vnet_timer * timer, unsigned long new
 
 
 #define Vnet_Print(level, fmt, args...)                                        \
-    do {       \
-       extern int vnet_debug;  \
-       if(level <= vnet_debug) {   \
+    do {                                                               \
+       extern int vnet_debug;                                          \
+       if(level <= vnet_debug) {                                       \
            extern struct vnet_host_hooks * host_hooks;                 \
            if ((host_hooks) && (host_hooks)->print) {                  \
                (host_hooks)->print((fmt), ##args);                     \
-           }                                                   \
-       }                                                       \
+           }                                                           \
+       }                                                               \
     } while (0)        
 
 
 #define Vnet_Debug(fmt, args...)                                       \
-    do {       \
-           extern struct vnet_host_hooks * host_hooks;                 \
-           if ((host_hooks) && (host_hooks)->print) {                  \
-               (host_hooks)->print((fmt), ##args);                     \
-           }                                                                                           \
+    do {                                                               \
+       extern struct vnet_host_hooks * host_hooks;                     \
+       if ((host_hooks) && (host_hooks)->print) {                      \
+           (host_hooks)->print((fmt), ##args);                         \
+       }                                                               \
     } while (0)        
 
 
 
-
 /* Lock Utilities */
 int vnet_lock_init(vnet_lock_t * lock);
 
@@ -254,8 +256,6 @@ static inline void vnet_unlock_irqrestore(vnet_lock_t lock, addr_t irq_state) {
 
 
 
-\r
-
 void init_vnet(struct vnet_host_hooks * hooks);
 
 
index 946de1f..42c9d3b 100644 (file)
@@ -88,10 +88,10 @@ struct queue_entry{
 
 #define VNET_QUEUE_SIZE 1024
 struct vnet_queue {
-       struct queue_entry buf[VNET_QUEUE_SIZE];
-       int head, tail;
-       int count;
-       vnet_lock_t lock;
+    struct queue_entry buf[VNET_QUEUE_SIZE];
+    int head, tail;
+    int count;
+    vnet_lock_t lock;
 };
 
 static struct {
@@ -423,7 +423,7 @@ static struct route_list * match_route(const struct v3_vnet_pkt * pkt) {
     }
 
     matches = (struct route_list *)Vnet_Malloc(sizeof(struct route_list) + 
-                               (sizeof(struct vnet_route_info *) * num_matches));
+                                              (sizeof(struct vnet_route_info *) * num_matches));
 
     matches->num_routes = num_matches;
 
@@ -485,7 +485,7 @@ int vnet_tx_one_pkt(struct v3_vnet_pkt * pkt, void * private_data) {
 
            if (bridge == NULL) {
                Vnet_Print(2, "VNET/P Core: No active bridge to sent data to\n");
-                continue;
+               continue;
            }
 
            if(bridge->brg_ops.input(bridge->vm, pkt, bridge->private_data) < 0){
@@ -567,7 +567,7 @@ int v3_vnet_send_pkt(struct v3_vnet_pkt * pkt, void * private_data, int synchron
        vnet_tx_one_pkt(pkt, NULL);
     }else {
        vnet_pkt_enqueue(pkt);
-       Vnet_Print(2, "VNET/P Core: Put pkt into Queue: pkt size %d\n", pkt->size);
+       Vnet_Print(2, "VNET/P Core: Put pkt into Queue: pkt size %d\n", pkt->size);
     }
        
     return 0;
index ba9ef8e..fb6820d 100644 (file)
@@ -177,8 +177,8 @@ static const uint_t load_factors[] = {
 const uint_t prime_table_length = sizeof(primes) / sizeof(primes[0]);
 
 struct hashtable * vnet_create_htable(uint_t min_size,
-                                   uint_t (*hash_fn) (addr_t),
-                                   int (*eq_fn) (addr_t, addr_t)) {
+                                     uint_t (*hash_fn) (addr_t),
+                                     int (*eq_fn) (addr_t, addr_t)) {
     struct hashtable * htable;
     uint_t prime_index;
     uint_t size = primes[0];
index ea64c6d..9d3bb31 100644 (file)
@@ -52,7 +52,8 @@ struct vnet_thread * vnet_start_thread(int (*func)(void *), void *arg, char * na
 
 
 struct vnet_timer * vnet_create_timer(unsigned long interval, 
-       void (* timer_fun)(void * priv_data), void * priv_data){
+                                     void (* timer_fun)(void * priv_data), 
+                                     void * priv_data){
     struct vnet_timer * timer = NULL; 
 
     if((host_hooks) && host_hooks->timer_create){