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();
});
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)
/** @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();