-/* Copyright (c) 2013-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2013-2023. 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. */
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(vm_live_migration, s4u, "S4U virtual machines live migration");
-namespace simgrid {
-namespace plugin {
-namespace vm {
+namespace simgrid::plugin::vm {
xbt::Extension<s4u::Host, VmMigrationExt> VmMigrationExt::EXTENSION_ID;
void VmMigrationExt::ensureVmMigrationExtInstalled()
bool received_finalize = false;
std::string finalize_task_name =
- std::string("__mig_stage3:") + vm_->get_cname() + "(" + src_pm_->get_cname() + "-" + dst_pm_->get_cname() + ")";
+ "__mig_stage3:" + vm_->get_name() + "(" + src_pm_->get_name() + "-" + dst_pm_->get_name() + ")";
while (not received_finalize) {
auto payload = mbox->get_unique<std::string>();
}
// Inform the SRC that the migration has been correctly performed
auto* payload = new std::string("__mig_stage4:");
- *payload = *payload + vm_->get_cname() + "(" + src_pm_->get_cname() + "-" + dst_pm_->get_cname() + ")";
+ *payload = *payload + vm_->get_name() + "(" + src_pm_->get_name() + "-" + dst_pm_->get_name() + ")";
mbox_ctl->put(payload, 0);
// effectively the VM on the DST node.
XBT_DEBUG("mig: tx_done");
}
-} // namespace vm
-} // namespace plugin
-} // namespace simgrid
+} // namespace simgrid::plugin::vm
using simgrid::plugin::vm::VmMigrationExt;
vm->start_migration();
- std::string rx_name =
- std::string("__pr_mig_rx:") + vm->get_cname() + "(" + src_pm->get_cname() + "-" + dst_pm->get_cname() + ")";
- std::string tx_name =
- std::string("__pr_mig_tx:") + vm->get_cname() + "(" + src_pm->get_cname() + "-" + dst_pm->get_cname() + ")";
+ std::string rx_name = "__pr_mig_rx:" + vm->get_name() + "(" + src_pm->get_name() + "-" + dst_pm->get_name() + ")";
+ std::string tx_name = "__pr_mig_tx:" + vm->get_name() + "(" + src_pm->get_name() + "-" + dst_pm->get_name() + ")";
simgrid::s4u::ActorPtr rx =
simgrid::s4u::Actor::create(rx_name.c_str(), dst_pm, simgrid::plugin::vm::MigrationRx(vm, dst_pm));
/* wait until the migration have finished or on error has occurred */
XBT_DEBUG("wait for reception of the final ACK (i.e. migration has been correctly performed");
- simgrid::s4u::Mailbox* mbox_ctl = simgrid::s4u::Mailbox::by_name(
- std::string("__mbox_mig_ctl:") + vm->get_cname() + "(" + src_pm->get_cname() + "-" + dst_pm->get_cname() + ")");
+ simgrid::s4u::Mailbox* mbox_ctl = simgrid::s4u::Mailbox::by_name("__mbox_mig_ctl:" + vm->get_name() + "(" +
+ src_pm->get_name() + "-" + dst_pm->get_name() + ")");
mbox_ctl->get_unique<std::string>();
tx->join();
rx->join();