X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5599d4e76aba57753485b2dbd00e8f8fb0e3c90c..458365ff86f7085f8d5081f4bad873bdb7339171:/src/surf/vm_workstation.c diff --git a/src/surf/vm_workstation.c b/src/surf/vm_workstation.c index 94933ebd1e..23a287b516 100644 --- a/src/surf/vm_workstation.c +++ b/src/surf/vm_workstation.c @@ -34,15 +34,28 @@ static void vm_ws_create(const char *name, void *ind_phys_workstation) xbt_lib_set(host_lib, name, SURF_WKS_LEVEL, vm_ws); } +/* + * Update the physical host of the given VM + */ +static void vm_ws_migrate(void *ind_vm_workstation, void *ind_dest_phys_workstation) +{ + /* ind_phys_workstation equals to smx_host_t */ + workstation_VM2013_t vm_ws = surf_workstation_resource_priv(ind_vm_workstation); + xbt_assert(vm_ws); + + /* do something */ + + vm_ws->physical_workstation = surf_workstation_resource_priv(ind_dest_phys_workstation); +} /* * A physical host does not disapper in the current SimGrid code, but a VM may * disapper during a simulation. */ -static void vm_ws_destroy(void *ind_phys_workstation) +static void vm_ws_destroy(void *ind_vm_workstation) { /* ind_phys_workstation equals to smx_host_t */ - workstation_VM2013_t vm_ws = surf_workstation_resource_priv(ind_phys_workstation); + workstation_VM2013_t vm_ws = surf_workstation_resource_priv(ind_vm_workstation); xbt_assert(vm_ws); xbt_assert(vm_ws->generic_resource.model == surf_vm_workstation_model); @@ -70,6 +83,7 @@ static void surf_vm_workstation_model_init_internal(void) surf_vm_workstation_model->extension.vm_workstation.create = vm_ws_create; surf_vm_workstation_model->extension.vm_workstation.set_state = vm_ws_set_state; surf_vm_workstation_model->extension.vm_workstation.get_state = vm_ws_get_state; + surf_vm_workstation_model->extension.vm_workstation.migrate = vm_ws_migrate; surf_vm_workstation_model->extension.vm_workstation.destroy = vm_ws_destroy; }