X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fpci_passthrough.c;h=b8f921b5d962d61096bab91369bc8797224545af;hb=b45b6127e0af286c2dbd0c972a34bd88860a748a;hp=8552112957e87a666bf8aef4d7af23c02d71c6fa;hpb=e5e029575affad90c19ca038a3b780820535d421;p=palacios.git diff --git a/palacios/src/devices/pci_passthrough.c b/palacios/src/devices/pci_passthrough.c index 8552112..b8f921b 100644 --- a/palacios/src/devices/pci_passthrough.c +++ b/palacios/src/devices/pci_passthrough.c @@ -753,9 +753,6 @@ static int setup_virt_pci_dev(struct v3_vm_info * vm_info, struct vm_device * de static struct v3_device_ops dev_ops = { .free = NULL, - .reset = NULL, - .start = NULL, - .stop = NULL, }; @@ -793,10 +790,11 @@ static int passthrough_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { strncpy(state->name, dev_id, 32); - dev = v3_allocate_device(dev_id, &dev_ops, state); + dev = v3_add_device(vm, dev_id, &dev_ops, state); - if (v3_attach_device(vm, dev) == -1) { + if (dev == NULL) { PrintError("Could not attach device %s\n", dev_id); + V3_Free(state); return -1; } @@ -807,6 +805,7 @@ static int passthrough_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { PrintError("Could not find PCI Device %s:%s\n", v3_cfg_val(cfg, "vendor_id"), v3_cfg_val(cfg, "device_id")); + v3_remove_device(dev); return 0; }