X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d3d4c51aace6f9daab7ee7bf664d9d56c81070f8..6ca0df6f5bb17b5708c11a19846c0e90e25b7889:/src/plugins/vm/s4u_VirtualMachine.cpp?ds=sidebyside diff --git a/src/plugins/vm/s4u_VirtualMachine.cpp b/src/plugins/vm/s4u_VirtualMachine.cpp index c08518a5c7..5dfaf837c6 100644 --- a/src/plugins/vm/s4u_VirtualMachine.cpp +++ b/src/plugins/vm/s4u_VirtualMachine.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2015-2018. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -41,7 +41,7 @@ VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm, int coreAmount, /* Make a process container */ extension_set(new simgrid::simix::Host()); - if (TRACE_msg_vm_is_enabled()) { + if (TRACE_vm_is_enabled()) { container_t host_container = instr::Container::byName(pm->getName()); new instr::Container(name, "MSG_VM", host_container); instr::Container::byName(getName())->getState("MSG_VM_STATE")->addEntityValue("start", "0 0 1"); // start is blue @@ -66,16 +66,13 @@ VirtualMachine::~VirtualMachine() /* Don't free these things twice: they are the ones of my physical host */ pimpl_netpoint = nullptr; - if (TRACE_msg_vm_is_enabled()) { - container_t container = simgrid::instr::Container::byName(getName()); - container->removeFromParent(); - delete container; - } + if (TRACE_vm_is_enabled()) + simgrid::instr::Container::byName(getName())->removeFromParent(); } void VirtualMachine::start() { - if (TRACE_msg_vm_is_enabled()) + if (TRACE_vm_is_enabled()) simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->pushEvent("start"); simgrid::simix::kernelImmediate([this]() { @@ -107,7 +104,7 @@ void VirtualMachine::start() this->pimpl_vm_->setState(SURF_VM_STATE_RUNNING); }); - if (TRACE_msg_vm_is_enabled()) + if (TRACE_vm_is_enabled()) simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->popEvent(); } @@ -115,7 +112,7 @@ void VirtualMachine::suspend() { smx_actor_t issuer = SIMIX_process_self(); simgrid::simix::kernelImmediate([this, issuer]() { pimpl_vm_->suspend(issuer); }); - if (TRACE_msg_vm_is_enabled()) + if (TRACE_vm_is_enabled()) simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->pushEvent("suspend"); XBT_DEBUG("vm_suspend done"); } @@ -123,7 +120,7 @@ void VirtualMachine::suspend() void VirtualMachine::resume() { pimpl_vm_->resume(); - if (TRACE_msg_vm_is_enabled()) + if (TRACE_vm_is_enabled()) simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->popEvent(); } @@ -309,25 +306,5 @@ void sg_vm_destroy(sg_vm_t vm) { vm->destroy(); } -/* ************************** Backward ABI compatibility *************************** */ -sg_vm_t MSG_vm_create_core(sg_host_t pm, const char* name) __attribute__((alias("sg_vm_create_core"))); -sg_vm_t MSG_vm_create_multicore(sg_host_t pm, const char* name, int coreAmount) - __attribute__((alias("sg_vm_create_multicore"))); - -int MSG_vm_is_created(sg_vm_t vm) __attribute__((alias("sg_vm_is_created"))); -int MSG_vm_is_running(sg_vm_t vm) __attribute__((alias("sg_vm_is_running"))); -int MSG_vm_is_suspended(sg_vm_t vm) __attribute__((alias("sg_vm_is_suspended"))); - -const char* MSG_vm_get_name(sg_vm_t vm) __attribute__((alias("sg_vm_get_name"))); -void MSG_vm_set_ramsize(sg_vm_t vm, size_t size) __attribute__((alias("sg_vm_set_ramsize"))); -size_t MSG_vm_get_ramsize(sg_vm_t vm) __attribute__((alias("sg_vm_get_ramsize"))); -sg_host_t MSG_vm_get_pm(sg_vm_t vm) __attribute__((alias("sg_vm_get_pm"))); -void MSG_vm_set_bound(sg_vm_t vm, double bound) __attribute__((alias("sg_vm_set_bound"))); - -void MSG_vm_start(sg_vm_t vm) __attribute__((alias("sg_vm_start"))); -void MSG_vm_suspend(sg_vm_t vm) __attribute__((alias("sg_vm_suspend"))); -void MSG_vm_resume(sg_vm_t vm) __attribute__((alias("sg_vm_resume"))); -void MSG_vm_shutdown(sg_vm_t vm) __attribute__((alias("sg_vm_shutdown"))); -void MSG_vm_destroy(sg_vm_t vm) __attribute__((alias("sg_vm_destroy"))); SG_END_DECL()