#include <simgrid/vm.h>
#include "src/kernel/resource/VirtualMachineImpl.hpp"
-#include "src/surf/cpu_cas01.hpp"
+#include "src/kernel/resource/models/cpu_cas01.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_vm, s4u, "S4U virtual machines");
EXTENSION_ID = Host::extension_create<VmHostExt>();
}
-VirtualMachine::VirtualMachine(const std::string& name, s4u::Host* physical_host, int core_amount, size_t ramsize)
- : Host(new kernel::resource::VirtualMachineImpl(name, this, physical_host, core_amount, ramsize))
- , pimpl_vm_(dynamic_cast<kernel::resource::VirtualMachineImpl*>(Host::get_impl()))
-{
- physical_host->get_impl()->create_vm(name, this);
-}
-
VirtualMachine::VirtualMachine(kernel::resource::VirtualMachineImpl* impl)
: Host(impl), pimpl_vm_(dynamic_cast<kernel::resource::VirtualMachineImpl*>(Host::get_impl()))
{
XBT_DEBUG("destroy %s", get_cname());
on_vm_destruction(*this);
+ on_this_vm_destruction(*this);
/* Then, destroy the VM object */
kernel::actor::simcall_answered(
[this]() { get_vm_impl()->get_physical_host()->get_impl()->destroy_vm(get_name()); });