From: Martin Quinson Date: Wed, 15 Feb 2023 15:51:00 +0000 (+0100) Subject: Allow to add a disk to a host after a load_platform from xml X-Git-Tag: v3.34~536 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a48a21761805fa35836d89b496ccc7efb90f7bb4 Allow to add a disk to a host after a load_platform from xml Fix https://github.com/simgrid/simgrid/issues/383 --- diff --git a/ChangeLog b/ChangeLog index 99a7e6a3b3..89aeda6e73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -48,7 +48,8 @@ Fixed bugs (FG#.. -> FramaGit bugs; FG!.. -> FG merge requests) (FG: issues on Framagit; GH: issues on GitHub) - FG#18: Java bindings should be redone or removed - FG!118: Wi-Fi callback mechanism - - FG!119: SMPI: add option to inject a barrier before every collective call, to allow... + - FG!119: SMPI: add option to inject a barrier before every collective call + - GH#383: Segfault when adding a disk after load_platform(xml) ---------------------------------------------------------------------------- diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index 8f3925b142..f07e935f24 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -207,6 +207,8 @@ s4u::Disk* HostImpl::create_disk(const std::string& name, double read_bandwidth, { auto disk = piface_.get_netpoint()->get_englobing_zone()->get_disk_model()->create_disk(name, read_bandwidth, write_bandwidth); + if (sealed_) + disk->seal(); return disk->set_host(&piface_)->get_iface(); }