Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Multiple .so support for region snapshots
[simgrid.git] / src / surf / workstation_interface.cpp
index d967225..6b021c5 100644 (file)
@@ -125,6 +125,7 @@ void Workstation::setState(e_surf_resource_state_t state){
   e_surf_resource_state_t old = Resource::getState();
   Resource::setState(state);
   surf_callback_emit(workstationStateChangedCallbacks, this, old, state);
+  p_cpu->setState(state);
 }
 
 int Workstation::getCore(){
@@ -251,7 +252,7 @@ ActionPtr Workstation::open(const char* fullpath) {
   else
     xbt_die("Can't find mount point for '%s' on '%s'", fullpath, getName());
 
-  XBT_DEBUG("OPEN %s on disk '%s'",fd->name, st->getName());
+  XBT_DEBUG("OPEN %s on disk '%s'",path, st->getName());
   ActionPtr action = st->open((const char*)mount_name, (const char*)path);
   free((char*)path);
   free((char*)mount_name);
@@ -375,7 +376,7 @@ int Workstation::fileMove(surf_file_t fd, const char* fullpath){
 
 xbt_dynar_t Workstation::getVms()
 {
-  xbt_dynar_t dyn = xbt_dynar_new(sizeof(smx_host_t), NULL);
+  xbt_dynar_t dyn = xbt_dynar_new(sizeof(WorkstationVMPtr), NULL);
 
   /* iterate for all virtual machines */
   for (WorkstationVMModel::vm_list_t::iterator iter =
@@ -383,8 +384,8 @@ xbt_dynar_t Workstation::getVms()
        iter !=  WorkstationVMModel::ws_vms.end(); ++iter) {
 
     WorkstationVMPtr ws_vm = &*iter;
-    if (this == ws_vm-> p_subWs)
-      xbt_dynar_push(dyn, &ws_vm->p_subWs);
+    if (this == ws_vm->p_subWs)
+      xbt_dynar_push(dyn, &ws_vm);
   }
 
   return dyn;