From 86f0b802957d99f6262ce3336293d9b5f2e63890 Mon Sep 17 00:00:00 2001 From: Bruno Donassolo Date: Tue, 1 Jun 2021 17:48:47 +0200 Subject: [PATCH] Cannot set split-duplex through s4u intf. This makes sense only in XML where it properly creates the link-up/link-down. --- src/s4u/s4u_Link.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/s4u/s4u_Link.cpp b/src/s4u/s4u_Link.cpp index 5badfff208..ba86b41b75 100644 --- a/src/s4u/s4u_Link.cpp +++ b/src/s4u/s4u_Link.cpp @@ -94,6 +94,10 @@ Link* Link::set_bandwidth(double value) Link* Link::set_sharing_policy(Link::SharingPolicy policy) { + if (policy == SharingPolicy::SPLITDUPLEX) + throw std::invalid_argument(std::string("Impossible to set split-duplex for the link: ") + get_name() + + std::string(". You should create a link-up and link-down to emulate this behavior")); + kernel::actor::simcall([this, policy] { pimpl_->set_sharing_policy(policy); }); return this; } -- 2.20.1