/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "smx_private.h"
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "smx_private.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_vm, simix, "Logging specific to SIMIX (vms)");
/* **** create a VM **** */
/**
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_vm, simix, "Logging specific to SIMIX (vms)");
/* **** create a VM **** */
/**
- * \brief Internal function to create a SIMIX host.
- * \param name name of the host to create
- * \param data some user data (may be NULL)
+ * @brief Internal function to create a SIMIX host.
+ * @param name name of the host to create
+ * @param data some user data (may be NULL)
}
void SIMIX_vm_start(sg_host_t ind_vm)
{
if (__can_be_started(ind_vm))
static_cast<simgrid::surf::VirtualMachine*>(
}
void SIMIX_vm_start(sg_host_t ind_vm)
{
if (__can_be_started(ind_vm))
static_cast<simgrid::surf::VirtualMachine*>(
- THROWF(vm_error, 0, "The VM %s cannot be started", SIMIX_host_get_name(ind_vm));
+ THROWF(vm_error, 0, "The VM %s cannot be started", sg_host_get_name(ind_vm));
}
e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t ind_vm)
{
return static_cast<simgrid::surf::VirtualMachine*>(
}
e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t ind_vm)
{
return static_cast<simgrid::surf::VirtualMachine*>(
* The simcall actually invokes the following calls:
* simcall_vm_set_affinity(vm, src_pm, 0);
* simcall_vm_migrate(vm, dst_pm);
* The simcall actually invokes the following calls:
* simcall_vm_set_affinity(vm, src_pm, 0);
* simcall_vm_migrate(vm, dst_pm);
- * \param vm VM to migrate
- * \param src_pm Source physical host
- * \param dst_pmt Destination physical host
+ * @param vm VM to migrate
+ * @param src_pm Source physical host
+ * @param dst_pmt Destination physical host
- * \param host the vm host (a sg_host_t)
- * \param host the pm host (a sg_host_t)
- * \param mask affinity mask (a unsigned long)
+ * @param host the vm host (a sg_host_t)
+ * @param host the pm host (a sg_host_t)
+ * @param mask affinity mask (a unsigned long)
* VM. All the processes on this VM will pause. The state of the VM is
* preserved on memory. We can later resume it again.
*
* VM. All the processes on this VM will pause. The state of the VM is
* preserved on memory. We can later resume it again.
*
if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
THROWF(vm_error, 0, "VM(%s) is not running", name);
if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
THROWF(vm_error, 0, "VM(%s) is not running", name);
smx_process_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
smx_process_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_SUSPENDED)
THROWF(vm_error, 0, "VM(%s) was not suspended", name);
if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_SUSPENDED)
THROWF(vm_error, 0, "VM(%s) was not suspended", name);
smx_process_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
smx_process_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
* This function is the same as vm_suspend, but the state of the VM is saved to the disk, and not preserved on memory.
* We can later restore it again.
*
* This function is the same as vm_suspend, but the state of the VM is saved to the disk, and not preserved on memory.
* We can later restore it again.
*
if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
THROWF(vm_error, 0, "VM(%s) is not running", name);
if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
THROWF(vm_error, 0, "VM(%s) is not running", name);
smx_process_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
smx_process_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_SAVED)
THROWF(vm_error, 0, "VM(%s) was not saved", name);
if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_SAVED)
THROWF(vm_error, 0, "VM(%s) was not saved", name);
smx_process_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
smx_process_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
* VM. All the processes on this VM will be killed. But, the state of the VM is
* preserved on memory. We can later start it again.
*
* VM. All the processes on this VM will be killed. But, the state of the VM is
* preserved on memory. We can later start it again.
*
if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
THROWF(vm_error, 0, "VM(%s) is not running", name);
if (SIMIX_vm_get_state(ind_vm) != SURF_VM_STATE_RUNNING)
THROWF(vm_error, 0, "VM(%s) is not running", name);
smx_process_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
smx_process_t smx_process, smx_process_safe;
xbt_swag_foreach_safe(smx_process, smx_process_safe, sg_host_simix(ind_vm)->process_list) {
SIMIX_process_kill(smx_process, issuer);
}
/* FIXME: we may have to do something at the surf layer, e.g., vcpu action */
static_cast<simgrid::surf::VirtualMachine*>(
SIMIX_process_kill(smx_process, issuer);
}
/* FIXME: we may have to do something at the surf layer, e.g., vcpu action */
static_cast<simgrid::surf::VirtualMachine*>(
XBT_DEBUG("destroy %s", hostname);
/* this will call the registered callback function, i.e., SIMIX_host_destroy(). */
XBT_DEBUG("destroy %s", hostname);
/* this will call the registered callback function, i.e., SIMIX_host_destroy(). */