Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Fixed merge conflict in vmm_halt.c
[palacios.git] / palacios / src / palacios / vmm_dev_mgr.c
index de6209b..a9e2af9 100644 (file)
@@ -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);
@@ -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) {