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.


refactoring to the point of compilation
[palacios.git] / palacios / src / devices / pci_passthrough.c
index 18e4ef4..4ccbba3 100644 (file)
@@ -331,7 +331,11 @@ static int pci_bar_write(int bar_num, uint32_t * src, void * private_data) {
     struct pt_bar * pbar = &(state->phys_bars[bar_num]);
     struct pt_bar * vbar = &(state->virt_bars[bar_num]);
 
-    PrintDebug("Bar update src=0x%x\n", *src);
+    PrintDebug("Bar update: bar_num=%d, src=0x%x\n", bar_num,*src);
+    PrintDebug("vbar is size=%u, type=%d, addr=0x%x, val=0x%x\n",vbar->size, vbar->type, vbar->addr, vbar->val);
+    PrintDebug("pbar is size=%u, type=%d, addr=0x%x, val=0x%x\n",pbar->size, pbar->type, pbar->addr, pbar->val);
+
+
 
     if (vbar->type == PT_BAR_NONE) {
        return 0;
@@ -544,10 +548,10 @@ static int irq_handler(struct guest_info * info, struct v3_interrupt * intr, voi
 
 
 
-static int passthrough_init(struct guest_info * info, v3_cfg_tree_t * cfg) {
+static int passthrough_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     struct pt_dev_state * state = V3_Malloc(sizeof(struct pt_dev_state));
     struct vm_device * dev = NULL;
-    struct vm_device * pci = v3_find_dev(info, v3_cfg_val(cfg, "bus"));
+    struct vm_device * pci = v3_find_dev(vm, v3_cfg_val(cfg, "bus"));
     char * name = v3_cfg_val(cfg, "name");    
 
     memset(state, 0, sizeof(struct pt_dev_state));
@@ -563,7 +567,7 @@ static int passthrough_init(struct guest_info * info, v3_cfg_tree_t * cfg) {
 
     dev = v3_allocate_device(name, &dev_ops, state);
 
-    if (v3_attach_device(info, dev) == -1) {
+    if (v3_attach_device(vm, dev) == -1) {
        PrintError("Could not attach device %s\n", name);
        return -1;
     }
@@ -578,9 +582,9 @@ static int passthrough_init(struct guest_info * info, v3_cfg_tree_t * cfg) {
        return 0;
     }
 
-    setup_virt_pci_dev(info, dev);
+    setup_virt_pci_dev(vm, dev);
 
-    v3_hook_irq(info, atoi(v3_cfg_val(cfg, "irq")), irq_handler, dev);
+    v3_hook_irq(vm, atoi(v3_cfg_val(cfg, "irq")), irq_handler, dev);
     //    v3_hook_irq(info, 64, irq_handler, dev);
 
     return 0;