{
msg_host_t vm0 = MSG_vm_create_core(pm0, "VM0");
- s_ws_params_t params;
+ s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
params.ramsize = 1L * 1000 * 1000 * 1000; // 1Gbytes
MSG_host_set_params(vm0, ¶ms);
XBT_INFO("create %s on PM(%s)", vm_name, MSG_host_get_name(pm));
msg_vm_t vm = MSG_vm_create_core(pm, vm_name);
- s_ws_params_t params;
+ s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes
MSG_host_set_params(vm, ¶ms);
msg_host_t pm1 = xbt_dynar_get_as(hosts_dynar, 1, msg_host_t);
msg_host_t pm2 = xbt_dynar_get_as(hosts_dynar, 2, msg_host_t);
msg_vm_t vm0, vm1;
- s_ws_params_t params;
+ s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
msg_vm_t vm2 = MSG_vm_create_core(pm2, "VM2");
msg_vm_t vm3 = MSG_vm_create_core(pm2, "VM3");
- s_ws_params_t params;
+ s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
params.ramsize = 1L * 1024 * 1024;
params.skip_stage1 = 1;
XBT_INFO("### Relocate VM0 between PM0 and PM1");
vm0 = MSG_vm_create_core(pm0, "VM0");
{
- s_ws_params_t params;
+ s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes
MSG_host_set_params(vm0, ¶ms);
#ifndef SIMGRID_DATATYPES_H_
#define SIMGRID_DATATYPES_H_
-typedef struct ws_params {
+typedef struct vm_params {
int ncpus;
sg_size_t ramsize;
int overcommit;
/* set migration speed */
double mig_speed;
-} s_ws_params_t, *ws_params_t;
+} s_vm_params_t, *vm_params_t;
#endif /* SIMGRID_DATATYPES_H_ */
XBT_PUBLIC(int) MSG_host_get_pstate(msg_host_t host);
XBT_PUBLIC(xbt_dynar_t) MSG_hosts_as_dynar(void);
XBT_PUBLIC(int) MSG_get_host_number(void);
-XBT_PUBLIC(void) MSG_host_get_params(msg_host_t ind_pm, ws_params_t params);
-XBT_PUBLIC(void) MSG_host_set_params(msg_host_t ind_pm, ws_params_t params);
+XBT_PUBLIC(void) MSG_host_get_params(msg_host_t ind_pm, vm_params_t params);
+XBT_PUBLIC(void) MSG_host_set_params(msg_host_t ind_pm, vm_params_t params);
XBT_PUBLIC(xbt_dict_t) MSG_host_get_mounted_storage_list(msg_host_t host);
XBT_PUBLIC(xbt_dynar_t) MSG_host_get_attached_storage_list(msg_host_t host);
XBT_PUBLIC(xbt_dict_t) MSG_host_get_storage_content(msg_host_t host);
XBT_PUBLIC(e_smx_state_t) simcall_host_execution_wait(smx_synchro_t execution);
XBT_PUBLIC(xbt_dict_t) simcall_host_get_mounted_storage_list(sg_host_t host);
XBT_PUBLIC(xbt_dynar_t) simcall_host_get_attached_storage_list(sg_host_t host);
-XBT_PUBLIC(void) simcall_host_get_params(sg_host_t vm, ws_params_t param);
-XBT_PUBLIC(void) simcall_host_set_params(sg_host_t vm, ws_params_t param);
+XBT_PUBLIC(void) simcall_host_get_params(sg_host_t vm, vm_params_t param);
+XBT_PUBLIC(void) simcall_host_set_params(sg_host_t vm, vm_params_t param);
/******************************* VM simcalls ********************************/
// Create the vm_workstation at the SURF level
/** @brief Get the list of VMs hosted on the host */
XBT_PUBLIC(xbt_dynar_t) surf_host_get_vms(surf_resource_t resource);
-/**
- * @brief [brief description]
- * @details [long description]
- *
- * @param resource [description]
- * @param params [description]
+/** @brief Retrieve the params of that VM
+ * @details You can use fields ramsize and overcommit on a PM, too.
*/
-XBT_PUBLIC(void) surf_host_get_params(surf_resource_t resource, ws_params_t params);
+XBT_PUBLIC(void) surf_host_get_params(surf_resource_t resource, vm_params_t params);
-/**
- * @brief [brief description]
- * @details [long description]
- *
- * @param resource [description]
- * @param params [description]
+/** @brief Sets the params of that VM/PM
+ * @details You can use fields ramsize and overcommit on a PM, too.
*/
-XBT_PUBLIC(void) surf_host_set_params(surf_resource_t resource, ws_params_t params);
+XBT_PUBLIC(void) surf_host_set_params(surf_resource_t resource, vm_params_t params);
/**
* @brief Destroy a VM
*/
XBT_PUBLIC(void) surf_vm_destroy(surf_resource_t resource);
-/**
- * @brief Suspend a VM
- *
- * @param resource The surf vm
- */
+/** @brief Suspend a VM */
XBT_PUBLIC(void) surf_vm_suspend(surf_resource_t resource);
-/**
- * @brief Resume a VM
- *
- * @param resource The surf vm
- */
+/** @brief Resume a VM */
XBT_PUBLIC(void) surf_vm_resume(surf_resource_t resource);
/**
* \param host a host
* \param params a prameter object
*/
-void MSG_host_set_params(msg_host_t host, ws_params_t params)
+void MSG_host_set_params(msg_host_t host, vm_params_t params)
{
simcall_host_set_params(host, params);
}
* \param host a host
* \param params a prameter object
*/
-void MSG_host_get_params(msg_host_t host, ws_params_t params)
+void MSG_host_get_params(msg_host_t host, vm_params_t params)
{
simcall_host_get_params(host, params);
}
double update_speed = ((double)dp_intensity/100) * mig_netspeed;
msg_vm_t vm = MSG_vm_create_core(ind_pm, name);
- s_ws_params_t params;
+ s_vm_params_t params;
memset(¶ms, 0, sizeof(params));
params.ramsize = (sg_size_t)ramsize * 1024 * 1024;
//params.overcommit = 0;
// The structure has been created in the do_migration function and should only be freed in the same place ;)
struct migration_session *ms = MSG_process_get_data(MSG_process_self());
- s_ws_params_t params;
+ s_vm_params_t params;
simcall_host_get_params(ms->vm, ¶ms);
int need_exit = 0;
// Note that the ms structure has been allocated in do_migration and hence should be freed in the same function ;)
struct migration_session *ms = MSG_process_get_data(MSG_process_self());
- s_ws_params_t params;
+ s_vm_params_t params;
simcall_host_get_params(ms->vm, ¶ms);
const sg_size_t ramsize = params.ramsize;
const sg_size_t devsize = params.devsize;
simcall_BODY_vm_set_affinity(vm, pm, mask);
}
-void simcall_host_get_params(sg_host_t vm, ws_params_t params)
+void simcall_host_get_params(sg_host_t vm, vm_params_t params)
{
simcall_BODY_host_get_params(vm, params);
}
-void simcall_host_set_params(sg_host_t vm, ws_params_t params)
+void simcall_host_set_params(sg_host_t vm, vm_params_t params)
{
simcall_BODY_host_set_params(vm, params);
}
static inline void simcall_host_get_params__set__ind_vm(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
}
-static inline ws_params_t simcall_host_get_params__get__params(smx_simcall_t simcall) {
- return (ws_params_t) simcall->args[1].dp;
+static inline vm_params_t simcall_host_get_params__get__params(smx_simcall_t simcall) {
+ return (vm_params_t) simcall->args[1].dp;
}
static inline void simcall_host_get_params__set__params(smx_simcall_t simcall, void* arg) {
simcall->args[1].dp = arg;
static inline void simcall_host_set_params__set__ind_vm(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
}
-static inline ws_params_t simcall_host_set_params__get__params(smx_simcall_t simcall) {
- return (ws_params_t) simcall->args[1].dp;
+static inline vm_params_t simcall_host_set_params__get__params(smx_simcall_t simcall) {
+ return (vm_params_t) simcall->args[1].dp;
}
static inline void simcall_host_set_params__set__params(smx_simcall_t simcall, void* arg) {
simcall->args[1].dp = arg;
return self->simcall.result.dp;
}
-inline static void simcall_BODY_host_get_params(sg_host_t ind_vm, ws_params_t params) {
+inline static void simcall_BODY_host_get_params(sg_host_t ind_vm, vm_params_t params) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
}
-inline static void simcall_BODY_host_set_params(sg_host_t ind_vm, ws_params_t params) {
+inline static void simcall_BODY_host_set_params(sg_host_t ind_vm, vm_params_t params) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
break;
case SIMCALL_HOST_GET_PARAMS:
- SIMIX_host_get_params((sg_host_t) simcall->args[0].dp,(ws_params_t) simcall->args[1].dp);
+ SIMIX_host_get_params((sg_host_t) simcall->args[0].dp,(vm_params_t) simcall->args[1].dp);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_HOST_SET_PARAMS:
- SIMIX_host_set_params((sg_host_t) simcall->args[0].dp,(ws_params_t) simcall->args[1].dp);
+ SIMIX_host_set_params((sg_host_t) simcall->args[0].dp,(vm_params_t) simcall->args[1].dp);
SIMIX_simcall_answer(simcall);
break;
Blck H host_execution_wait (int) (execution, void*, smx_synchro_t)
Func - host_get_mounted_storage_list (void*, xbt_dict_t) (host, void*, sg_host_t)
Func - host_get_attached_storage_list (void*, xbt_dynar_t) (host, void*, sg_host_t)
-Proc - host_get_params (void) (ind_vm, void*, sg_host_t) (params, void*, ws_params_t)
-Proc - host_set_params (void) (ind_vm, void*, sg_host_t) (params, void*, ws_params_t)
+Proc - host_get_params (void) (ind_vm, void*, sg_host_t) (params, void*, vm_params_t)
+Proc - host_set_params (void) (ind_vm, void*, sg_host_t) (params, void*, vm_params_t)
Func - vm_create (void*, sg_host_t) (name, const char*) (ind_pm, void*, sg_host_t)
Proc - vm_start (void) (ind_vm, void*, sg_host_t)
Func - vm_get_state (int) (ind_vm, void*, sg_host_t)
* \param host the host to get_phys_host (a sg_host_t)
* \param param the parameter object space to be overwritten (a ws_params_t)
*/
-void SIMIX_host_get_params(sg_host_t ind_vm, ws_params_t params)
+void SIMIX_host_get_params(sg_host_t ind_vm, vm_params_t params)
{
/* jump to ws_get_params(). */
surf_host_get_params(ind_vm, params);
}
-void SIMIX_host_set_params(sg_host_t ind_vm, ws_params_t params)
+void SIMIX_host_set_params(sg_host_t ind_vm, vm_params_t params)
{
/* jump to ws_set_params(). */
surf_host_set_params(ind_vm, params);
void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm);
-void SIMIX_host_get_params(sg_host_t ind_vm, ws_params_t params);
+void SIMIX_host_get_params(sg_host_t ind_vm, vm_params_t params);
-void SIMIX_host_set_params(sg_host_t ind_vm, ws_params_t params);
+void SIMIX_host_set_params(sg_host_t ind_vm, vm_params_t params);
SG_END_DECL()
/* works for VMs and PMs */
static long host_get_ramsize(sg_host_t vm, int *overcommit)
{
- s_ws_params_t params;
+ s_vm_params_t params;
surf_host_get_params(vm, ¶ms);
if (overcommit)
return dyn;
}
-void Host::getParams(ws_params_t params)
+void Host::getParams(vm_params_t params)
{
*params = p_params;
}
-void Host::setParams(ws_params_t params)
+void Host::setParams(vm_params_t params)
{
/* may check something here. */
p_params = *params;
xbt_dynar_t getVms();
/* common with vm */
- /**
- * @brief [brief description]
- * @details [long description]
- *
- * @param params [description]
- */
- void getParams(ws_params_t params);
-
- /**
- * @brief [brief description]
- * @details [long description]
- *
- * @param params [description]
- */
- void setParams(ws_params_t params);
- s_ws_params_t p_params;
+ /** @brief Retrieve a copy of the parameters of that VM/PM
+ * @details The ramsize and overcommit fields are used on the PM too */
+ void getParams(vm_params_t params);
+ /** @brief Sets the params of that VM/PM */
+ void setParams(vm_params_t params);
+private:
+ s_vm_params_t p_params;
};
/**********
return vms_;
}
-void surf_host_get_params(surf_resource_t host, ws_params_t params){
+void surf_host_get_params(surf_resource_t host, vm_params_t params){
get_casted_host(host)->getParams(params);
}
-void surf_host_set_params(surf_resource_t host, ws_params_t params){
+void surf_host_set_params(surf_resource_t host, vm_params_t params){
get_casted_host(host)->setParams(params);
}