X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/81e3c97faf69f3b26a807758efedde49e2a6abf6..b7c53df18dcbf388f0dce6d7baa3086436028313:/src/plugins/vm/VmLiveMigration.hpp?ds=sidebyside diff --git a/src/plugins/vm/VmLiveMigration.hpp b/src/plugins/vm/VmLiveMigration.hpp index 39cde37a6c..a9a2755f04 100644 --- a/src/plugins/vm/VmLiveMigration.hpp +++ b/src/plugins/vm/VmLiveMigration.hpp @@ -1,9 +1,11 @@ -/* Copyright (c) 2004-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2004-2021. 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. */ -#include "simgrid/s4u.hpp" +#include "simgrid/s4u/Engine.hpp" +#include "simgrid/s4u/Mailbox.hpp" +#include "simgrid/s4u/VirtualMachine.hpp" #ifndef VM_LIVE_MIGRATION_HPP_ #define VM_LIVE_MIGRATION_HPP_ @@ -16,7 +18,6 @@ public: s4u::ActorPtr tx_ = nullptr; s4u::ActorPtr rx_ = nullptr; static simgrid::xbt::Extension EXTENSION_ID; - virtual ~VmMigrationExt() = default; explicit VmMigrationExt(s4u::ActorPtr issuer, s4u::ActorPtr rx, s4u::ActorPtr tx) : issuer_(issuer), tx_(tx), rx_(rx) { } @@ -24,10 +25,11 @@ public: }; class MigrationRx { - /* The miration_rx process uses mbox_ctl to let the caller of do_migration() know the completion of the migration. */ - s4u::MailboxPtr mbox_ctl; + /* The migration_rx process uses mbox_ctl to let the caller of do_migration() know the completion of the migration. + */ + s4u::Mailbox* mbox_ctl; /* The migration_rx and migration_tx processes use mbox to transfer migration data. */ - s4u::MailboxPtr mbox; + s4u::Mailbox* mbox; s4u::VirtualMachine* vm_; s4u::Host* src_pm_ = nullptr; s4u::Host* dst_pm_ = nullptr; @@ -35,19 +37,19 @@ class MigrationRx { public: explicit MigrationRx(s4u::VirtualMachine* vm, s4u::Host* dst_pm) : vm_(vm), dst_pm_(dst_pm) { - src_pm_ = vm_->getPm(); + src_pm_ = vm_->get_pm(); - mbox_ctl = s4u::Mailbox::byName(std::string("__mbox_mig_ctl:") + vm_->getCname() + "(" + src_pm_->getCname() + "-" + - dst_pm_->getCname() + ")"); - mbox = s4u::Mailbox::byName(std::string("__mbox_mig_src_dst:") + vm_->getCname() + "(" + src_pm_->getCname() + "-" + - dst_pm_->getCname() + ")"); + 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() + ")"); } void operator()(); }; class MigrationTx { /* The migration_rx and migration_tx processes use mbox to transfer migration data. */ - s4u::MailboxPtr mbox; + s4u::Mailbox* mbox; s4u::VirtualMachine* vm_; s4u::Host* src_pm_ = nullptr; s4u::Host* dst_pm_ = nullptr; @@ -55,9 +57,9 @@ class MigrationTx { public: explicit MigrationTx(s4u::VirtualMachine* vm, s4u::Host* dst_pm) : vm_(vm), dst_pm_(dst_pm) { - src_pm_ = vm_->getPm(); - mbox = s4u::Mailbox::byName(std::string("__mbox_mig_src_dst:") + vm_->getCname() + "(" + src_pm_->getCname() + "-" + - dst_pm_->getCname() + ")"); + 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() + ")"); } void operator()(); sg_size_t sendMigrationData(sg_size_t size, int stage, int stage2_round, double mig_speed, double timeout);