#include <xbt/functional.hpp>
+#include <simgrid/s4u/VirtualMachine.hpp>
#include <simgrid/simix/blocking_simcall.hpp>
#include "mc/mc.h"
return (e_smx_state_t) simcall_BODY_execution_wait(execution);
}
-
/**
* \ingroup simix_vm_management
* \brief Create a VM on the given physical host.
*
* \param name VM name
- * \param host Physical host
+ * \param dest Physical host on which to create the VM
*
* \return The host object of the VM
*/
-sg_host_t simcall_vm_create(const char *name, sg_host_t phys_host)
+sg_host_t simcall_vm_create(const char* name, sg_host_t dest)
{
- return simgrid::simix::kernelImmediate([&name, &phys_host] {
- sg_host_t host = surf_vm_model->createVM(name, phys_host);
+ return simgrid::simix::kernelImmediate([&name, &dest] {
+ sg_host_t host = new simgrid::s4u::VirtualMachine(name, dest);
host->extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
return host;
std::deque<VirtualMachineImpl*> VirtualMachineImpl::allVms_;
-s4u::Host* VMModel::createVM(const char* name, s4u::Host* host_PM)
-{
- return new s4u::VirtualMachine(name, host_PM);
-}
-
/* In the real world, processes on the guest operating system will be somewhat degraded due to virtualization overhead.
* The total CPU share these processes get is smaller than that of the VM process gets on a host operating system. */
// const double virt_overhead = 0.95;
*/
class VMModel : public HostModel {
public:
- /**
- * @brief Create a new VM
- *
- * @param name The name of the new VM
- * @param host_PM The real machine hosting the VM
- */
- s4u::Host* createVM(const char* name, s4u::Host* host_PM);
void adjustWeightOfDummyCpuActions() override{};
double nextOccuringEvent(double now) override;