#include <xbt/ex.hpp>
+#include <simgrid/s4u/VirtualMachine.hpp>
#include <simgrid/s4u/host.hpp>
#include "msg_private.h"
{
xbt_dict_set(MSG_host_get_properties(vm), name, value, free_ctn);
}
+/** \ingroup m_vm_management
+ * \brief Set the parameters of a given host
+ *
+ * \param vm a vm
+ * \param params a parameter object
+ */
+void MSG_vm_set_params(msg_vm_t vm, vm_params_t params)
+{
+ static_cast<simgrid::s4u::VirtualMachine*>(vm)->setParameters(params);
+}
+
+/** \ingroup m_vm_management
+ * \brief Get the parameters of a given host
+ *
+ * \param host a host
+ * \param params a prameter object
+ */
+void MSG_vm_get_params(msg_vm_t vm, vm_params_t params)
+{
+ static_cast<simgrid::s4u::VirtualMachine*>(vm)->parameters(params);
+}
/** \ingroup msg_vm_management
* \brief Finds a msg_vm_t using its name.
//XBT_INFO("dp rate %f migspeed : %f intensity mem : %d, updatespeed %f, hostspeed %f",params.dp_rate,
// params.mig_speed, dp_intensity, update_speed, host_speed);
- vm->setParameters(¶ms);
+ static_cast<simgrid::s4u::VirtualMachine*>(vm)->setParameters(¶ms);
return vm;
}
{
/* make sure the VM of the same name does not exit */
{
- simgrid::s4u::Host* ind_host_tmp = (simgrid::s4u::Host*) xbt_dict_get_or_null(host_list, name);
+ simgrid::s4u::Host* ind_host_tmp = sg_host_by_name(name);
if (ind_host_tmp != nullptr && sg_host_simix(ind_host_tmp) != nullptr) {
XBT_ERROR("host %s already exits", name);
return nullptr;
/* Note: ind_vm and vm_workstation point to the same elm object. */
/* Ask the SIMIX layer to create the surf vm resource */
- sg_host_t ind_vm_workstation = (sg_host_t) simcall_vm_create(name, ind_pm);
+ sg_host_t ind_vm_workstation = simcall_vm_create(name, ind_pm);
msg_vm_t ind_vm = (msg_vm_t) __MSG_host_create(ind_vm_workstation);
struct migration_session *ms = (migration_session *) MSG_process_get_data(MSG_process_self());
s_vm_params_t params;
- ms->vm->parameters(¶ms);
+ static_cast<simgrid::s4u::VirtualMachine*>(ms->vm)->parameters(¶ms);
int need_exit = 0;
migration_session *ms = (migration_session *) MSG_process_get_data(MSG_process_self());
s_vm_params_t params;
- ms->vm->parameters(¶ms);
+ static_cast<simgrid::s4u::VirtualMachine*>(ms->vm)->parameters(¶ms);
const sg_size_t ramsize = params.ramsize;
const sg_size_t devsize = params.devsize;
const int skip_stage1 = params.skip_stage1;