X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_dev_mgr.c;h=a9e2af998579bf046ac91adc66eb6e0d9b16d1ed;hb=a686a57429dcd9fa2f701228227dadcd096df8ed;hp=7d44131511580c80d39305bac232aa1553af4280;hpb=c30d1b88a60c3a8df426ce81553675bbe4afef52;p=palacios.releases.git diff --git a/palacios/src/palacios/vmm_dev_mgr.c b/palacios/src/palacios/vmm_dev_mgr.c index 7d44131..a9e2af9 100644 --- a/palacios/src/palacios/vmm_dev_mgr.c +++ b/palacios/src/palacios/vmm_dev_mgr.c @@ -68,7 +68,7 @@ int V3_init_devices() { while (tmp_dev != __stop__v3_devices) { - PrintDebug("Device: %s\n", tmp_dev->name); + V3_Print("Registering Device: %s\n", tmp_dev->name); if (v3_htable_search(master_dev_table, (addr_t)(tmp_dev->name))) { PrintError("Multiple instance of device (%s)\n", tmp_dev->name); @@ -437,6 +437,13 @@ struct vm_device * v3_add_device(struct v3_vm_info * vm, struct vmm_dev_mgr * mgr = &(vm->dev_mgr); struct vm_device * dev = NULL; + + // Check if we already registered a device of the same name + if (v3_htable_search(mgr->dev_table, (addr_t)name) != (addr_t)NULL) { + PrintError("Device with name (%s) already registered with VM\n", name); + return NULL; + } + dev = (struct vm_device *)V3_Malloc(sizeof(struct vm_device)); if (dev == NULL) {