X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fio_apic.c;h=95392d00f832ba4333950e4053d0432f820b60fc;hp=3bd5902e3a03e779861a345f9c0dff7b27f31088;hb=123a1ba27ea09c8fa77a1b36ce625b43d7c48b14;hpb=0e097100a26bc43eb8964734fa43130fc4c71429 diff --git a/palacios/src/devices/io_apic.c b/palacios/src/devices/io_apic.c index 3bd5902..95392d0 100644 --- a/palacios/src/devices/io_apic.c +++ b/palacios/src/devices/io_apic.c @@ -21,7 +21,7 @@ #include #include #include - +#include #ifndef CONFIG_DEBUG_IO_APIC #undef PrintDebug @@ -319,11 +319,12 @@ static struct v3_device_ops dev_ops = { -static int ioapic_init(struct guest_info * vm, void * cfg_data) { - struct vm_device * apic = v3_find_dev(vm, (char *)cfg_data); +static int ioapic_init(struct guest_info * vm, v3_cfg_tree_t * cfg) { + struct vm_device * apic = v3_find_dev(vm, v3_cfg_val(cfg, "irq_bus")); + char * name = v3_cfg_val(cfg, "name"); if (!apic) { - PrintError("Could not locate APIC device (%s)\n", (char *)cfg_data); + PrintError("Could not locate APIC device (%s)\n", v3_cfg_val(cfg, "irq_bus")); return -1; } @@ -333,11 +334,11 @@ static int ioapic_init(struct guest_info * vm, void * cfg_data) { ioapic->apic = apic; - struct vm_device * dev = v3_allocate_device("IOAPIC", &dev_ops, ioapic); + struct vm_device * dev = v3_allocate_device(name, &dev_ops, ioapic); if (v3_attach_device(vm, dev) == -1) { - PrintError("Could not attach device %s\n", "IOAPIC"); + PrintError("Could not attach device %s\n", name); return -1; }