A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git]
/
src
/
plugins
/
vm
/
s4u_VirtualMachine.cpp
diff --git
a/src/plugins/vm/s4u_VirtualMachine.cpp
b/src/plugins/vm/s4u_VirtualMachine.cpp
index
ba9c167
..
97d2749
100644
(file)
--- a/
src/plugins/vm/s4u_VirtualMachine.cpp
+++ b/
src/plugins/vm/s4u_VirtualMachine.cpp
@@
-3,16
+3,10
@@
/* 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. */
/* 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 "simgrid/datatypes.h"
-#include "simgrid/s4u/VirtualMachine.hpp"
-#include "simgrid/s4u/host.hpp"
-#include "simgrid/simix.hpp"
#include "src/instr/instr_private.h"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
#include "src/simix/smx_host_private.h"
#include "src/instr/instr_private.h"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
#include "src/simix/smx_host_private.h"
-#include "src/surf/HostImpl.hpp"
#include "src/surf/cpu_cas01.hpp"
#include "src/surf/cpu_cas01.hpp"
-#include "xbt/asserts.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_vm, "S4U virtual machines");
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_vm, "S4U virtual machines");
@@
-23,9
+17,9
@@
VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm) : Host(name)
{
XBT_DEBUG("Create VM %s", name);
{
XBT_DEBUG("Create VM %s", name);
- pimpl_vm_ = new
surf
::VirtualMachineImpl(this, pm);
+ pimpl_vm_ = new
vm
::VirtualMachineImpl(this, pm);
/* Currently, a VM uses the network resource of its physical host */
/* Currently, a VM uses the network resource of its physical host */
- pimpl_net
card = pm->pimpl_netcard
;
+ pimpl_net
point = pm->pimpl_netpoint
;
// Create a VCPU for this VM
surf::CpuCas01* sub_cpu = dynamic_cast<surf::CpuCas01*>(pm->pimpl_cpu);
// Create a VCPU for this VM
surf::CpuCas01* sub_cpu = dynamic_cast<surf::CpuCas01*>(pm->pimpl_cpu);
@@
-37,7
+31,7
@@
VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm) : Host(name)
extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
if (TRACE_msg_vm_is_enabled()) {
extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
if (TRACE_msg_vm_is_enabled()) {
- container_t host_container = PJ_container_get(
sg_host_get_name(pm
));
+ container_t host_container = PJ_container_get(
pm->cname(
));
PJ_container_new(name, INSTR_MSG_VM, host_container);
}
}
PJ_container_new(name, INSTR_MSG_VM, host_container);
}
}
@@
-46,7
+40,7
@@
VirtualMachine::~VirtualMachine()
{
onDestruction(*this);
{
onDestruction(*this);
- XBT_DEBUG("destroy %s",
name().c_str
());
+ XBT_DEBUG("destroy %s",
cname
());
/* FIXME: this is really strange that everything fails if the next line is removed.
* This is as if we shared these data with the PM, which definitely should not be the case...
/* FIXME: this is really strange that everything fails if the next line is removed.
* This is as if we shared these data with the PM, which definitely should not be the case...
@@
-57,7
+51,7
@@
VirtualMachine::~VirtualMachine()
extension_set<simgrid::simix::Host>(nullptr);
/* Don't free these things twice: they are the ones of my physical host */
extension_set<simgrid::simix::Host>(nullptr);
/* Don't free these things twice: they are the ones of my physical host */
- pimpl_net
card
= nullptr;
+ pimpl_net
point
= nullptr;
}
bool VirtualMachine::isMigrating()
}
bool VirtualMachine::isMigrating()
@@
-68,6
+62,10
@@
double VirtualMachine::getRamsize()
{
return pimpl_vm_->params_.ramsize;
}
{
return pimpl_vm_->params_.ramsize;
}
+simgrid::s4u::Host* VirtualMachine::pm()
+{
+ return pimpl_vm_->getPm();
+}
/** @brief Retrieve a copy of the parameters of that VM/PM
* @details The ramsize and overcommit fields are used on the PM too */
/** @brief Retrieve a copy of the parameters of that VM/PM
* @details The ramsize and overcommit fields are used on the PM too */