* \param value what to change the property to
* \param free_ctn the freeing function to use to kill the value on need
*/
-void MSG_vm_set_property_value(msg_vm_t vm, const char *name, void *value,void_f_pvoid_t free_ctn) {
-
- xbt_dict_set(MSG_host_get_properties(vm), name, value,free_ctn);
+void MSG_vm_set_property_value(msg_vm_t vm, const char *name, void *value, void_f_pvoid_t free_ctn)
+{
+ xbt_dict_set(MSG_host_get_properties(vm), name, value, free_ctn);
}
/** \ingroup msg_vm_management
* for each VM/PM.
*/
-msg_vm_t MSG_vm_get_by_name(const char *name){
+msg_vm_t MSG_vm_get_by_name(const char *name)
+{
return MSG_get_host_by_name(name);
}
* This functions checks whether \a host is a valid pointer or not and return
its name.
*/
-const char *MSG_vm_get_name(msg_vm_t vm) {
+const char *MSG_vm_get_name(msg_vm_t vm)
+{
return MSG_host_get_name(vm);
}
/* **** Check state of a VM **** */
-static inline int __MSG_vm_is_state(msg_vm_t vm, e_surf_vm_state_t state) {
+static inline int __MSG_vm_is_state(msg_vm_t vm, e_surf_vm_state_t state)
+{
return simcall_vm_get_state(vm) == state;
}
msg_vm_t ind_vm = NULL;
void *ind_vm_workstation = NULL;
- // Ask simix to create the surf vm resource
+ /* Ask the SIMIX layer to create the surf vm resource */
ind_vm_workstation = simcall_vm_create(name, ind_pm);
ind_vm = (msg_vm_t) __MSG_host_create(ind_vm_workstation);
}
-/** @brief Start a vm (ie. boot)
+/** @brief Start a vm (i.e., boot the guest operating system)
* @ingroup msg_VMs
*
* If the VM cannot be started, an exception is generated.
*/
void MSG_vm_start(msg_vm_t vm)
{
- //Please note that vm start can raise an exception if the VM cannot be started.
simcall_vm_start(vm);
#ifdef HAVE_TRACING
#include "surf/surf_resource.h"
#include "simgrid/sg_config.h"
#include "vm_workstation_private.h"
-#include "surf/cpu_cas01_private.h"
-#include "surf/maxmin_private.h"
+#include "cpu_cas01_private.h"
+#include "maxmin_private.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm_workstation, surf,
"Logging specific to the SURF VM workstation module");
workstation_VM2013_t vm_ws = surf_workstation_resource_priv(ind_vm_workstation);
cpu_Cas01_t cpu = surf_cpu_resource_priv(ind_vm_workstation);
const char *name = vm_ws->ws.generic_resource.name;
- XBT_INFO("%s", name);
xbt_assert(vm_ws);
xbt_assert(vm_ws->ws.generic_resource.model == surf_vm_workstation_model);
{
workstation_VM2013_t vm_ws = surf_workstation_resource_priv(ind_vm_ws);
- XBT_INFO("vm %p suspend", ind_vm_ws);
surf_action_suspend(vm_ws->cpu_action);
vm_ws->current_state = SURF_VM_STATE_SUSPENDED;
}
-
/* Adding a task to a VM updates the VCPU task on its physical machine. */
surf_action_t vm_ws_execute(void *workstation, double size)
{