]> AND Public Git Repository - simgrid.git/blobdiff - src/plugins/vm/VmLiveMigration.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix bad cast spotted by UBSan.
[simgrid.git] / src / plugins / vm / VmLiveMigration.cpp
index 384d90f66e90c01561fd076d4aee5203cdd4a66a..209ec1563177971eeb681e71084b92e5a7633c44 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2019. 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. */
@@ -326,10 +326,10 @@ void sg_vm_migrate(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm)
 {
   simgrid::s4u::Host* src_pm = vm->get_pm();
 
-  if (src_pm->is_off())
+  if (not src_pm->is_on())
     THROWF(vm_error, 0, "Cannot migrate VM '%s' from host '%s', which is offline.", vm->get_cname(),
            src_pm->get_cname());
-  if (dst_pm->is_off())
+  if (not dst_pm->is_on())
     THROWF(vm_error, 0, "Cannot migrate VM '%s' to host '%s', which is offline.", vm->get_cname(), dst_pm->get_cname());
   if (vm->get_state() != simgrid::s4u::VirtualMachine::state::RUNNING)
     THROWF(vm_error, 0, "Cannot migrate VM '%s' that is not running yet.", vm->get_cname());