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.


Cleanup based on cppcheck pass (Devices and Extensions)
Peter Dinda [Wed, 1 Jul 2015 22:38:56 +0000 (17:38 -0500)]
palacios/src/devices/8237_dma.c
palacios/src/devices/i440fx.c
palacios/src/devices/ide.c
palacios/src/devices/lnx_virtio_sym.c
palacios/src/devices/rtl8139.c
palacios/src/extensions/ext_sched_edf.c
palacios/src/extensions/ext_trans_mem.c

index adb5b4b..f131138 100644 (file)
@@ -52,5 +52,5 @@ struct vm_device * v3_create_dma() {
 
     struct vm_device * dev = v3_create_device("DMA", &dev_ops, dma);
 
-    return dma;
+    return dev;
 }
index a68e275..510d08a 100644 (file)
@@ -99,13 +99,11 @@ static int i440_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
        ret |= v3_dev_hook_io(dev, 0x0cfc + i, &io_read, &io_write);
     }
 
-    /*
     if (ret != 0) {
        PrintError(vm, VCORE_NONE, "Error hooking i440FX io ports\n");
-       v3_remove_device(dev);
-       return -1;
+       //v3_remove_device(dev);
+       //return -1;
     }
-    */
 
     for (i = 0; i < 6; i++) {
        bars[i].type = PCI_BAR_NONE;
index 45aaba7..bf842e9 100644 (file)
@@ -507,7 +507,11 @@ static int dma_read(struct guest_info * core, struct ide_internal * ide, struct
                    cmd_ret = v3_write_gpa_memory(core, prd_entry.base_addr + prd_offset, 
                                                  bytes_to_write, drive->data_buf); 
 
-                   // check cmd_ret
+                   if (cmd_ret!=bytes_to_write) { 
+                       PrintError(core->vm_info, core, "Failed to write data to memory\n");
+                       return -1;
+                   }
+
 
 
                    bytes_to_write = 0;
index 3fbeffe..654b201 100644 (file)
@@ -48,7 +48,7 @@ struct virtio_sym_state {
     struct vm_device * pci_bus;
     struct pci_device * pci_dev;
 
-    struct virtio_queue queue[1];
+    struct virtio_queue queue[2];
 
     struct virtio_queue * cur_queue;
 
index aadfcea..9d4e7c7 100644 (file)
@@ -956,6 +956,8 @@ static int rx_one_pkt(struct rtl8139_state * nic_state,
     uint32_t header, val;
     uint8_t bcast_addr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 
+    header = 0;
+
     if (regs->rcr & AcceptAllPhys) {
        PrintDebug(VM_NONE, VCORE_NONE, "RTL8139: packet received in promiscuous mode\n");
     } else {
index 7694e3c..7b7c108 100644 (file)
@@ -595,7 +595,7 @@ delete_core_edf( struct vm_core_edf_sched *core_edf  , struct vm_edf_rq *runqueu
            return true;
         }
        else{
-           PrintError(core->info->vm_info, core->info,"EDF Sched. delete_core_edf.Attempted to erase unexisting core");
+           PrintError(VM_NONE,VCORE_NONE,"EDF Sched. delete_core_edf.Attempted to erase unexisting core");
             return false;
         }
 }
index 7a4c838..7fb8164 100644 (file)
@@ -1742,9 +1742,7 @@ deinit_trans_mem_core (struct guest_info * core,
     v3_lock_deinit(&(tm->addr_ctxt_lock));
     v3_lock_deinit(&(tm->access_type_lock));
 
-    if (tm) {
-        V3_Free(tm);
-    }
+    V3_Free(tm);
 
     return 0;
 }