-msg_vm_t MSG_vm_start(msg_host_t location, const char *name, int coreAmount) {
- msg_vm_t res = xbt_new0(s_msg_vm_t,1);
- res->all_vms_hookup.prev = NULL;
- res->host_vms_hookup.prev = NULL;
- res->state = msg_vm_state_running;
- res->location = location;
- res->coreAmount = coreAmount;
- res->name = xbt_strdup(name);
- res->processes = xbt_dynar_new(sizeof(msg_process_t),NULL);
-
- xbt_swag_insert(res,msg_global->vms);
- xbt_swag_insert(res, MSG_host_priv(location)->vms);
+msg_vm_t MSG_vm_create(msg_host_t location, const char *name,
+ int core_nb, int mem_cap, int net_cap){
+
+ // Note new and vm_workstation refer to the same area (due to the lib/dict appraoch)
+ msg_vm_t new = NULL;
+ void *vm_workstation = NULL;
+ // Ask simix to create the surf vm resource
+ vm_workstation = simcall_vm_create(name,location);
+ new = (msg_vm_t) __MSG_host_create(vm_workstation);
+
+
+ MSG_vm_set_property_value(new, "CORE_NB", bprintf("%d", core_nb)), NULL);
+ MSG_vm_set_property_value(new, "MEM_CAP", bprintf("%d", core_nb)), NULL);
+ MSG_vm_set_property_value(new, "NET_CAP", bprintf("%d", core_nb)), NULL);