Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further cosmetics in simix VM, which really needs them
[simgrid.git] / src / simix / smx_vm.cpp
index 768531c..c6c9709 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_vm, simix, "Logging specific to SIMIX Virtual Machines");
 
-/* **** create a VM **** */
-
-/**
- * @brief Internal function to create a SIMIX host.
- * @param name name of the host to create
- */
-sg_host_t SIMIX_vm_create(const char *name, sg_host_t phys_host)
-{
-  surf_vm_model->createVM(name, phys_host);
-  sg_host_t host = sg_host_by_name(name);
-  SIMIX_host_create(host);
-
-  return host;
-}
-
-
 /* works for VMs and PMs */
 static long host_get_ramsize(sg_host_t vm, int *overcommit)
 {
@@ -79,21 +63,21 @@ static int __can_be_started(sg_host_t vm)
   return 1;
 }
 
-void SIMIX_vm_start(sg_host_t ind_vm)
+void SIMIX_vm_start(sg_host_t vm)
 {
-  if (__can_be_started(ind_vm))
+  if (__can_be_started(vm))
     static_cast<simgrid::surf::VirtualMachine*>(
-      ind_vm->extension<simgrid::surf::HostImpl>()
+      vm->extension<simgrid::surf::HostImpl>()
     )->setState(SURF_VM_STATE_RUNNING);
   else
-    THROWF(vm_error, 0, "The VM %s cannot be started", sg_host_get_name(ind_vm));
+    THROWF(vm_error, 0, "The VM %s cannot be started", vm->name().c_str());
 }
 
 
-e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t ind_vm)
+e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t vm)
 {
   return static_cast<simgrid::surf::VirtualMachine*>(
-    ind_vm->extension<simgrid::surf::HostImpl>()
+    vm->extension<simgrid::surf::HostImpl>()
   )->getState();
 }
 
@@ -102,13 +86,13 @@ e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t ind_vm)
  *
  * @param host the vm host to migrate (a sg_host_t)
  */
-void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm)
+void SIMIX_vm_migrate(sg_host_t vm, sg_host_t dst_pm)
 {
   /* precopy migration makes the VM temporally paused */
-  xbt_assert(SIMIX_vm_get_state(ind_vm) == SURF_VM_STATE_SUSPENDED);
+  xbt_assert(SIMIX_vm_get_state(vm) == SURF_VM_STATE_SUSPENDED);
 
   /* jump to vm_ws_xigrate(). this will update the vm location. */
-  surf_vm_migrate(ind_vm, ind_dst_pm);
+  surf_vm_migrate(vm, dst_pm);
 }
 
 /**