Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / src / plugins / vm / VmLiveMigration.hpp
index 169b8b67ea9d4434da50af797903fc2a0d3f3590..0ac98a59f855c91f15408138dfec3f92566b3c2b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-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. */
@@ -10,9 +10,7 @@
 #ifndef VM_LIVE_MIGRATION_HPP_
 #define VM_LIVE_MIGRATION_HPP_
 
-namespace simgrid {
-namespace plugin {
-namespace vm {
+namespace simgrid::plugin::vm {
 class VmMigrationExt {
 public:
   s4u::ActorPtr issuer_ = nullptr;
@@ -40,10 +38,10 @@ public:
   {
     src_pm_ = vm_->get_pm();
 
-    mbox_ctl = s4u::Mailbox::by_name(std::string("__mbox_mig_ctl:") + vm_->get_cname() + "(" + src_pm_->get_cname() +
-                                     "-" + dst_pm_->get_cname() + ")");
-    mbox = s4u::Mailbox::by_name(std::string("__mbox_mig_src_dst:") + vm_->get_cname() + "(" + src_pm_->get_cname() +
-                                 "-" + dst_pm_->get_cname() + ")");
+    mbox_ctl = s4u::Mailbox::by_name("__mbox_mig_ctl:" + vm_->get_name() + "(" + src_pm_->get_name() + "-" +
+                                     dst_pm_->get_name() + ")");
+    mbox     = s4u::Mailbox::by_name("__mbox_mig_src_dst:" + vm_->get_name() + "(" + src_pm_->get_name() + "-" +
+                                 dst_pm_->get_name() + ")");
   }
   void operator()();
 };
@@ -59,13 +57,11 @@ public:
   explicit MigrationTx(s4u::VirtualMachine* vm, s4u::Host* dst_pm) : vm_(vm), dst_pm_(dst_pm)
   {
     src_pm_ = vm_->get_pm();
-    mbox    = s4u::Mailbox::by_name(std::string("__mbox_mig_src_dst:") + vm_->get_cname() + "(" + src_pm_->get_cname() +
-                                 "-" + dst_pm_->get_cname() + ")");
+    mbox    = s4u::Mailbox::by_name("__mbox_mig_src_dst:" + vm_->get_name() + "(" + src_pm_->get_name() + "-" +
+                                 dst_pm_->get_name() + ")");
   }
   void operator()();
   sg_size_t sendMigrationData(sg_size_t size, int stage, int stage2_round, double mig_speed, double timeout);
 };
-} // namespace vm
-} // namespace plugin
-} // namespace simgrid
+} // namespace simgrid::plugin::vm
 #endif