From: Jack Lange Date: Tue, 20 Sep 2011 19:25:40 +0000 (-0400) Subject: added error check for configurations with replicated device IDs X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=517acba107414f29b95967ecc46f4c7afdb782be;p=palacios.git added error check for configurations with replicated device IDs --- diff --git a/palacios/src/palacios/vmm_dev_mgr.c b/palacios/src/palacios/vmm_dev_mgr.c index 7d44131..d08b227 100644 --- a/palacios/src/palacios/vmm_dev_mgr.c +++ b/palacios/src/palacios/vmm_dev_mgr.c @@ -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) {