Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
VM: move things from MSG to the C++ plugin
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 21 Nov 2016 00:55:16 +0000 (01:55 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 21 Nov 2016 00:55:16 +0000 (01:55 +0100)
src/msg/msg_vm.cpp
src/plugins/vm/s4u_VirtualMachine.cpp

index c3c29d8..5eb5d1b 100644 (file)
@@ -182,21 +182,6 @@ void MSG_vm_destroy(msg_vm_t vm)
 
   /* Then, destroy the VM object */
   simgrid::simix::kernelImmediate([vm]() {
 
   /* Then, destroy the VM object */
   simgrid::simix::kernelImmediate([vm]() {
-    /* this code basically performs a similar thing like SIMIX_host_destroy() */
-    XBT_DEBUG("destroy %s", vm->name().c_str());
-
-    /* FIXME: this is really strange that everything fails if the next line is removed.
-     * This is as if we shared these data with the PM, which definitely should not be the case...
-     *
-     * We need to test that suspending a VM does not suspends the processes running on its PM, for example.
-     * Or we need to simplify this code enough to make it actually readable (but this sounds harder than testing)
-     */
-    vm->extension_set<simgrid::simix::Host>(nullptr);
-
-    /* Don't free these things twice: they are the ones of my physical host */
-    vm->pimpl_cpu     = nullptr;
-    vm->pimpl_netcard = nullptr;
-
     vm->destroy();
   });
 
     vm->destroy();
   });
 
index ec4ee2f..f46ee37 100644 (file)
@@ -34,6 +34,20 @@ VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm) : Host(name)
 VirtualMachine::~VirtualMachine()
 {
   onDestruction(*this);
 VirtualMachine::~VirtualMachine()
 {
   onDestruction(*this);
+
+  XBT_DEBUG("destroy %s", name().c_str());
+
+  /* FIXME: this is really strange that everything fails if the next line is removed.
+   * This is as if we shared these data with the PM, which definitely should not be the case...
+   *
+   * We need to test that suspending a VM does not suspends the processes running on its PM, for example.
+   * Or we need to simplify this code enough to make it actually readable (but this sounds harder than testing)
+   */
+  extension_set<simgrid::simix::Host>(nullptr);
+
+  /* Don't free these things twice: they are the ones of my physical host */
+  pimpl_cpu     = nullptr;
+  pimpl_netcard = nullptr;
 }
 
 bool VirtualMachine::isMigrating()
 }
 
 bool VirtualMachine::isMigrating()