From: Martin Quinson Date: Thu, 17 Nov 2016 09:50:55 +0000 (+0100) Subject: kill a bunch of brain-dead functions in surf X-Git-Tag: v3_14~181 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/94be8068a4d11801fad48e8c5825ce637fa52e32 kill a bunch of brain-dead functions in surf --- diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index c4cf703959..c8d73987cf 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -227,51 +227,6 @@ XBT_PUBLIC(sg_size_t) surf_host_get_free_size(sg_host_t resource, const char* na */ XBT_PUBLIC(sg_size_t) surf_host_get_used_size(sg_host_t resource, const char* name); -/** @brief Suspend a VM */ -XBT_PUBLIC(void) surf_vm_suspend(sg_host_t resource); - -/** @brief Resume a VM */ -XBT_PUBLIC(void) surf_vm_resume(sg_host_t resource); - -/** - * @brief Save the VM (Not yet implemented) - * - * @param resource The surf vm - */ -XBT_PUBLIC(void) surf_vm_save(sg_host_t resource); - -/** - * @brief Restore the VM (Not yet implemented) - * - * @param resource The surf vm - */ -XBT_PUBLIC(void) surf_vm_restore(sg_host_t resource); - -/** - * @brief Migrate the VM to the destination host - * - * @param resource The surf vm - * @param ind_vm_ws_dest The destination host - */ -XBT_PUBLIC(void) surf_vm_migrate(sg_host_t resource, sg_host_t ind_vm_ws_dest); - -/** - * @brief Get the physical machine hosting the VM - * - * @param resource The surf vm - * @return The physical machine hosting the VM - */ -XBT_PUBLIC(sg_host_t) surf_vm_get_pm(sg_host_t resource); - -/** - * @brief [brief description] - * @details [long description] - * - * @param resource [description] - * @param bound [description] - */ -XBT_PUBLIC(void) surf_vm_set_bound(sg_host_t resource, double bound); - /** * @brief Unlink a file descriptor * diff --git a/src/simix/smx_vm.cpp b/src/simix/smx_vm.cpp index 2866b91b4b..c104cc9b0a 100644 --- a/src/simix/smx_vm.cpp +++ b/src/simix/smx_vm.cpp @@ -26,7 +26,7 @@ static long host_get_ramsize(sg_host_t vm, int *overcommit) /* **** start a VM **** */ static int __can_be_started(sg_host_t vm) { - sg_host_t pm = surf_vm_get_pm(vm); + sg_host_t pm = static_cast(vm)->pimpl_vm_->getPm(); int pm_overcommit = 0; long pm_ramsize = host_get_ramsize(pm, &pm_overcommit); @@ -89,7 +89,7 @@ void SIMIX_vm_migrate(sg_host_t vm, sg_host_t dst_pm) 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(vm, dst_pm); + static_cast(vm)->pimpl_vm_->migrate(dst_pm); } /** @@ -121,7 +121,7 @@ void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst */ void *SIMIX_vm_get_pm(sg_host_t host) { - return surf_vm_get_pm(host); + return static_cast(host)->pimpl_vm_->getPm(); } /** @@ -132,7 +132,7 @@ void *SIMIX_vm_get_pm(sg_host_t host) */ void SIMIX_vm_set_bound(sg_host_t vm, double bound) { - surf_vm_set_bound(vm, bound); + static_cast(vm)->pimpl_vm_->setBound(bound); } /** @@ -150,7 +150,7 @@ void SIMIX_vm_suspend(sg_host_t vm, smx_actor_t issuer) XBT_DEBUG("suspend VM(%s), where %d processes exist", vm->name().c_str(), xbt_swag_size(sg_host_simix(vm)->process_list)); /* jump to vm_ws_suspend. The state will be set. */ - surf_vm_suspend(vm); + static_cast(vm)->pimpl_vm_->suspend(); smx_actor_t smx_process, smx_process_safe; xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(vm)->process_list) { @@ -186,7 +186,7 @@ void SIMIX_vm_resume(sg_host_t vm, smx_actor_t issuer) vm->name().c_str(), xbt_swag_size(sg_host_simix(vm)->process_list)); /* jump to vm_ws_resume() */ - surf_vm_resume(vm); + static_cast(vm)->pimpl_vm_->resume(); smx_actor_t smx_process, smx_process_safe; xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(vm)->process_list) { @@ -218,7 +218,7 @@ void SIMIX_vm_save(sg_host_t vm, smx_actor_t issuer) XBT_DEBUG("save VM(%s), where %d processes exist", name, xbt_swag_size(sg_host_simix(vm)->process_list)); /* jump to vm_ws_save() */ - surf_vm_save(vm); + static_cast(vm)->pimpl_vm_->resume(); smx_actor_t smx_process, smx_process_safe; xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(vm)->process_list) { @@ -248,7 +248,7 @@ void SIMIX_vm_restore(sg_host_t vm, smx_actor_t issuer) vm->name().c_str(), xbt_swag_size(sg_host_simix(vm)->process_list)); /* jump to vm_ws_restore() */ - surf_vm_resume(vm); + static_cast(vm)->pimpl_vm_->resume(); smx_actor_t smx_process, smx_process_safe; xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(vm)->process_list) { diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index f6d294473a..d13f01080b 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -213,34 +213,6 @@ int surf_host_file_move(sg_host_t host, surf_file_t fd, const char* fullpath){ return host->pimpl_->fileMove(fd, fullpath); } -void surf_vm_suspend(sg_host_t vm){ - static_cast(vm)->pimpl_vm_->suspend(); -} - -void surf_vm_resume(sg_host_t vm){ - static_cast(vm)->pimpl_vm_->resume(); -} - -void surf_vm_save(sg_host_t vm){ - static_cast(vm)->pimpl_vm_->save(); -} - -void surf_vm_restore(sg_host_t vm){ - static_cast(vm)->pimpl_vm_->restore(); -} - -void surf_vm_migrate(sg_host_t vm, sg_host_t ind_vm_ws_dest){ - static_cast(vm)->pimpl_vm_->migrate(ind_vm_ws_dest); -} - -sg_host_t surf_vm_get_pm(sg_host_t vm){ - return static_cast(vm)->pimpl_vm_->getPm(); -} - -void surf_vm_set_bound(sg_host_t vm, double bound){ - static_cast(vm)->pimpl_vm_->setBound(bound); -} - xbt_dict_t surf_storage_get_content(surf_resource_t resource){ return static_cast(surf_storage_resource_priv(resource))->getContent(); }