From da4d5cc414d9f30dd2948a392f35983be63bf49a Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 17 Nov 2016 11:02:37 +0100 Subject: [PATCH] kill 2 dumb functions in simix_vm --- src/simix/libsmx.cpp | 16 ++++++++++++---- src/simix/smx_host_private.h | 4 ---- src/simix/smx_vm.cpp | 21 --------------------- 3 files changed, 12 insertions(+), 29 deletions(-) diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 14d822610d..46a9e5ee92 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -219,19 +219,27 @@ int simcall_vm_get_state(sg_host_t vm) /** * \ingroup simix_vm_management - * \brief Get the name of the physical host on which the given VM runs. + * \brief Get the physical host on which the given VM runs. * * \param vm VM - * \return The name of the physical host + * \return The physical host */ void *simcall_vm_get_pm(sg_host_t vm) { - return simgrid::simix::kernelImmediate(std::bind(SIMIX_vm_get_pm, vm)); + return simgrid::simix::kernelImmediate( + [vm]() { return static_cast(vm)->pimpl_vm_->getPm(); }); } +/** + * @brief Function to set the CPU bound of the given SIMIX VM host. + * + * @param host the vm host (a sg_host_t) + * @param bound bound (a double) + */ void simcall_vm_set_bound(sg_host_t vm, double bound) { - simgrid::simix::kernelImmediate(std::bind(SIMIX_vm_set_bound, vm, bound)); + simgrid::simix::kernelImmediate( + [vm, bound]() { static_cast(vm)->pimpl_vm_->setBound(bound); }); } /** diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index 5c5b852186..bb557e5b9b 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -86,10 +86,6 @@ XBT_PRIVATE e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t ind_vm); // -- XBT_PRIVATE void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm); -XBT_PRIVATE void *SIMIX_vm_get_pm(sg_host_t ind_vm); - -XBT_PRIVATE void SIMIX_vm_set_bound(sg_host_t ind_vm, double bound); - XBT_PRIVATE void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm); SG_END_DECL() diff --git a/src/simix/smx_vm.cpp b/src/simix/smx_vm.cpp index c104cc9b0a..da216956c4 100644 --- a/src/simix/smx_vm.cpp +++ b/src/simix/smx_vm.cpp @@ -114,27 +114,6 @@ void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst SIMIX_vm_resume(vm, self); } -/** - * @brief Function to get the physical host of the given SIMIX VM host. - * - * @param host the vm host to get_phys_host (a sg_host_t) - */ -void *SIMIX_vm_get_pm(sg_host_t host) -{ - return static_cast(host)->pimpl_vm_->getPm(); -} - -/** - * @brief Function to set the CPU bound of the given SIMIX VM host. - * - * @param host the vm host (a sg_host_t) - * @param bound bound (a double) - */ -void SIMIX_vm_set_bound(sg_host_t vm, double bound) -{ - static_cast(vm)->pimpl_vm_->setBound(bound); -} - /** * @brief Function to suspend a SIMIX VM host. This function stops the execution of the * VM. All the processes on this VM will pause. The state of the VM is -- 2.20.1