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
move VM into their namespace, and greatly reduce the amount of sg_host_get_name ...
[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
13357ef
..
d648250
100644
(file)
--- a/
src/plugins/vm/s4u_VirtualMachine.cpp
+++ b/
src/plugins/vm/s4u_VirtualMachine.cpp
@@
-23,7
+23,7
@@
VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm) : Host(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 */
pimpl_netcard = pm->pimpl_netcard;
// Create a VCPU for this VM
@@
-37,7
+37,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()) {
- 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);
}
}
@@
-57,25
+57,28
@@
VirtualMachine::~VirtualMachine()
extension_set<simgrid::simix::Host>(nullptr);
/* Don't free these things twice: they are the ones of my physical host */
- pimpl_cpu = nullptr;
pimpl_netcard = nullptr;
}
bool VirtualMachine::isMigrating()
{
- return static_cast<surf::VirtualMachineImpl*>(pimpl_)->isMigrating;
+ return pimpl_vm_->isMigrating;
+}
+double VirtualMachine::getRamsize()
+{
+ return pimpl_vm_->params_.ramsize;
}
/** @brief Retrieve a copy of the parameters of that VM/PM
* @details The ramsize and overcommit fields are used on the PM too */
void VirtualMachine::parameters(vm_params_t params)
{
-
static_cast<surf::VirtualMachineImpl*>(pimpl_)
->getParams(params);
+
pimpl_vm_
->getParams(params);
}
/** @brief Sets the params of that VM/PM */
void VirtualMachine::setParameters(vm_params_t params)
{
- simgrid::simix::kernelImmediate([&]() {
static_cast<surf::VirtualMachineImpl*>(pimpl_)
->setParams(params); });
+ simgrid::simix::kernelImmediate([&]() {
pimpl_vm_
->setParams(params); });
}
} // namespace simgrid