/* 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"
#include "mc/mc.h"
-#include "src/surf/virtual_machine.hpp"
+#include "simgrid/s4u/VirtualMachine.hpp"
+#include "smx_private.h"
+#include "src/plugins/vm/VirtualMachineImpl.hpp"
#include "src/surf/HostImpl.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_vm, simix, "Logging specific to SIMIX Virtual Machines");
static long host_get_ramsize(sg_host_t vm, int *overcommit)
{
s_vm_params_t params;
- vm->extension<simgrid::surf::HostImpl>()->getParams(¶ms);
+ static_cast<simgrid::s4u::VirtualMachine*>(vm)->parameters(¶ms);
if (overcommit)
*overcommit = params.overcommit;
}
long total_ramsize_of_vms = 0;
- xbt_dynar_t dyn_vms = pm->extension<simgrid::surf::HostImpl>()->getVms();
+ xbt_dynar_t dyn_vms = pm->pimpl_->getVms();
{
unsigned int cursor = 0;
sg_host_t another_vm;
void SIMIX_vm_start(sg_host_t vm)
{
if (__can_be_started(vm))
- static_cast<simgrid::surf::VirtualMachine*>(
- vm->extension<simgrid::surf::HostImpl>()
- )->setState(SURF_VM_STATE_RUNNING);
+ static_cast<simgrid::surf::VirtualMachineImpl*>(vm->pimpl_)->setState(SURF_VM_STATE_RUNNING);
else
THROWF(vm_error, 0, "The VM %s cannot be started", vm->name().c_str());
}
e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t vm)
{
- return static_cast<simgrid::surf::VirtualMachine*>(
- vm->extension<simgrid::surf::HostImpl>()
- )->getState();
+ return static_cast<simgrid::surf::VirtualMachineImpl*>(vm->pimpl_)->getState();
}
/**
}
/* FIXME: we may have to do something at the surf layer, e.g., vcpu action */
- static_cast<simgrid::surf::VirtualMachine*>(
- vm->extension<simgrid::surf::HostImpl>()
- )->setState(SURF_VM_STATE_CREATED);
+ static_cast<simgrid::surf::VirtualMachineImpl*>(vm->pimpl_)->setState(SURF_VM_STATE_CREATED);
}
void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, sg_host_t vm)
SIMIX_vm_shutdown(vm, simcall->issuer);
}
-extern xbt_dict_t host_list; // FIXME:killme don't dupplicate the content of s4u::Host this way
- /**
- * @brief Function to destroy a SIMIX VM host.
- *
- * @param vm the vm host to destroy (a sg_host_t)
- */
+/**
+ * @brief Function to destroy a SIMIX VM host.
+ *
+ * @param vm the vm host to destroy (a sg_host_t)
+ */
void SIMIX_vm_destroy(sg_host_t vm)
{
/* this code basically performs a similar thing like SIMIX_host_destroy() */