X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fpci_passthrough.c;h=4ccbba3f11ea05fb0996a7095cdb2da20f9c4b83;hb=3e5e5a12e64630d7a37ed32b8d7e2d993c79f7e0;hp=18e4ef49608085f1b6e129909cfe46fc90129c63;hpb=0121a4503305424096e2b5c5bd3b6c3af2d813e5;p=palacios.git diff --git a/palacios/src/devices/pci_passthrough.c b/palacios/src/devices/pci_passthrough.c index 18e4ef4..4ccbba3 100644 --- a/palacios/src/devices/pci_passthrough.c +++ b/palacios/src/devices/pci_passthrough.c @@ -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;