+xbt_dynar_t WorkstationCLM03::getInfo( surf_file_t fd)
+{
+ StoragePtr st = findStorageOnMountList(fd->mount);
+ sg_size_t *psize = xbt_new(sg_size_t, 1);
+ *psize = fd->size;
+ xbt_dynar_t info = xbt_dynar_new(sizeof(void*), NULL);
+ xbt_dynar_push_as(info, sg_size_t *, psize);
+ xbt_dynar_push_as(info, void *, fd->mount);
+ xbt_dynar_push_as(info, void *, (void *)st->m_name);
+ xbt_dynar_push_as(info, void *, st->p_typeId);
+ xbt_dynar_push_as(info, void *, st->p_contentType);
+
+ return info;
+}
+
+sg_size_t WorkstationCLM03::fileTell(surf_file_t fd){
+ return fd->current_position;
+}
+
+int WorkstationCLM03::fileSeek(surf_file_t fd, sg_size_t offset, int origin){
+
+ switch (origin) {
+ case SEEK_SET:
+ fd->current_position = 0;
+ return MSG_OK;
+ case SEEK_CUR:
+ if(offset > fd->size)
+ offset = fd->size;
+ fd->current_position = offset;
+ return MSG_OK;
+ case SEEK_END:
+ fd->current_position = fd->size;
+ return MSG_OK;
+ default:
+ return MSG_TASK_CANCELED;
+ }
+}
+
+sg_size_t WorkstationCLM03::getFreeSize(const char* name)
+{
+ StoragePtr st = findStorageOnMountList(name);
+ return st->m_size - st->m_usedSize;
+}
+
+sg_size_t WorkstationCLM03::getUsedSize(const char* name)
+{
+ StoragePtr st = findStorageOnMountList(name);
+ return st->m_usedSize;
+}
+
+e_surf_resource_state_t WorkstationCLM03Lmm::getState() {
+ return WorkstationCLM03::getState();
+}
+
+xbt_dynar_t WorkstationCLM03::getVms()
+{
+ xbt_dynar_t dyn = xbt_dynar_new(sizeof(smx_host_t), NULL);
+
+ /* iterate for all hosts including virtual machines */
+ xbt_lib_cursor_t cursor;
+ char *key;
+ void **ind_host;
+ xbt_lib_foreach(host_lib, cursor, key, ind_host) {
+ WorkstationCLM03Ptr ws_clm03 = dynamic_cast<WorkstationCLM03Ptr>(static_cast<ResourcePtr>(ind_host[SURF_WKS_LEVEL]));
+ if (!ws_clm03)
+ continue;
+ /* skip if it is not a virtual machine */
+ if (ws_clm03->p_model != static_cast<ModelPtr>(surf_vm_workstation_model))
+ continue;
+
+ /* It is a virtual machine, so we can cast it to workstation_VM2013_t */
+ WorkstationVM2013Ptr ws_vm2013 = dynamic_cast<WorkstationVM2013Ptr>(ws_clm03);
+ if (this == ws_vm2013-> p_subWs)
+ xbt_dynar_push(dyn, &ws_vm2013->p_subWs);
+ }
+
+ return dyn;
+}
+
+void WorkstationCLM03::getParams(ws_params_t params)
+{
+ memcpy(params, &p_params, sizeof(s_ws_params_t));
+}
+
+void WorkstationCLM03::setParams(ws_params_t params)
+{
+ /* may check something here. */
+ memcpy(&p_params, params, sizeof(s_ws_params_t));
+}