+
+/** @brief Returns whether the given VM is being saved (FIXME: live saving or not?).
+ * @ingroup msg_VMs
+ */
+int MSG_vm_is_saving(msg_vm_t vm)
+{
+ return __MSG_vm_is_state(vm, msg_vm_state_saving);
+}
+
+/** @brief Returns whether the given VM has been saved, not running.
+ * @ingroup msg_VMs
+ */
+int MSG_vm_is_saved(msg_vm_t vm)
+{
+ return __MSG_vm_is_state(vm, msg_vm_state_saved);
+}
+
+/** @brief Returns whether the given VM is being restored, not running.
+ * @ingroup msg_VMs
+ */
+int MSG_vm_is_restoring(msg_vm_t vm)
+{
+ return __MSG_vm_is_state(vm, msg_vm_state_restoring);
+}
+
+
+
+/* ------------------------------------------------------------------------- */
+/* ------------------------------------------------------------------------- */
+
+/* **** ******** MSG vm actions ********* **** */
+
+/** @brief Create a new VM (the VM is just attached to the location but it is not started yet).
+ * @ingroup msg_VMs*
+ *
+ * Please note that a VM is a specific host. Hence, you should give a different name
+ * for each VM/PM.
+ */
+msg_vm_t MSG_vm_create(msg_host_t ind_host, 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 *ind_vm_workstation = NULL;
+ // Ask simix to create the surf vm resource
+ ind_vm_workstation = simcall_vm_create(name,ind_host);
+ new = (msg_vm_t) __MSG_host_create(ind_vm_workstation);
+
+ MSG_vm_set_property_value(new, "CORE_NB", bprintf("%d", core_nb), free);
+ MSG_vm_set_property_value(new, "MEM_CAP", bprintf("%d", mem_cap), free);
+ MSG_vm_set_property_value(new, "NET_CAP", bprintf("%d", net_cap), free);
+
+ XBT_DEBUG("A new VM has been created");
+ // TODO check whether the vm (i.e the virtual host) has been correctly added into the list of all hosts.
+
+ #ifdef HAVE_TRACING
+ TRACE_msg_vm_create(name, ind_host);
+ #endif
+
+ return new;
+}
+
+/** @brief Start a vm (ie. boot)