X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_dev_mgr.c;h=d08b227816fb2d709ab749674afbc5321402dd85;hb=517acba107414f29b95967ecc46f4c7afdb782be;hp=de6209b592566f0fe83fba5a8b10c874f71cf4b3;hpb=e00538192a2762cacb12b359b40f076cb4f3ba83;p=palacios.git diff --git a/palacios/src/palacios/vmm_dev_mgr.c b/palacios/src/palacios/vmm_dev_mgr.c index de6209b..d08b227 100644 --- a/palacios/src/palacios/vmm_dev_mgr.c +++ b/palacios/src/palacios/vmm_dev_mgr.c @@ -153,7 +153,8 @@ int v3_save_vm_devices(struct v3_vm_info * vm, struct v3_chkpt * chkpt) { if (dev->ops->save) { struct v3_chkpt_ctx * dev_ctx = NULL; - + + V3_Print("Saving state for device (%s)\n", dev->name); dev_ctx = v3_chkpt_open_ctx(chkpt, dev_mgr_ctx, dev->name); @@ -436,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) {