Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
VM: rename a symbol and improve comments
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 19 Dec 2016 15:18:44 +0000 (16:18 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 19 Dec 2016 23:11:07 +0000 (00:11 +0100)
src/msg/msg_vm.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/plugins/vm/VirtualMachineImpl.hpp

index 42f207d..6a9bf58 100644 (file)
@@ -324,7 +324,7 @@ static int migration_rx_fun(int argc, char *argv[])
     xbt_assert(vm->pimpl_vm_->getState() == SURF_VM_STATE_SUSPENDED);
 
     /* Update the vm location and resume it */
-    vm->pimpl_vm_->migrate(dst_pm);
+    vm->pimpl_vm_->setPm(dst_pm);
     vm->pimpl_vm_->resume();
   });
 
index 11b0f16..412cbd1 100644 (file)
@@ -252,21 +252,24 @@ s4u::Host* VirtualMachineImpl::getPm()
   return hostPM_;
 }
 
-/* Update the physical host of the given VM */
-void VirtualMachineImpl::migrate(s4u::Host* host_dest)
+/** @brief Change the physical host on which the given VM is running
+ *
+ * This is an instantaneous migration.
+ */
+void VirtualMachineImpl::setPm(s4u::Host* destination)
 {
   const char* vm_name     = piface_->cname();
   const char* pm_name_src = hostPM_->cname();
-  const char* pm_name_dst = host_dest->cname();
+  const char* pm_name_dst = destination->cname();
 
   /* update net_elm with that of the destination physical host */
-  piface_->pimpl_netcard = host_dest->pimpl_netcard;
+  piface_->pimpl_netcard = destination->pimpl_netcard;
 
-  hostPM_ = host_dest;
+  hostPM_ = destination;
 
   /* Update vcpu's action for the new pm */
   /* create a cpu action bound to the pm model at the destination. */
-  surf::CpuAction* new_cpu_action = static_cast<surf::CpuAction*>(host_dest->pimpl_cpu->execution_start(0));
+  surf::CpuAction* new_cpu_action = static_cast<surf::CpuAction*>(destination->pimpl_cpu->execution_start(0));
 
   surf::Action::State state = action_->getState();
   if (state != surf::Action::State::done)
index bc446c9..8af4347 100644 (file)
@@ -68,14 +68,14 @@ public:
   /** @brief Resume the VM */
   virtual void resume();
 
-  /** @brief Save the VM */
+  /** @brief Save (suspend+store on disk) the VM */
   virtual void save(smx_actor_t issuer);
 
-  /** @brief Restore the VM */
+  /** @brief Restore (read from disk+resume) the VM */
   virtual void restore();
 
-  /** @brief Migrate the VM to the destination host */
-  virtual void migrate(s4u::Host* dest);
+  /** @brief Change the physical host on which the given VM is running */
+  virtual void setPm(s4u::Host* dest);
 
   /** @brief Get the physical machine hosting the VM */
   s4u::Host* getPm();