- if (src_pm->is_off())
- 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())
- THROWF(vm_error, 0, "Cannot migrate VM '%s' to host '%s', which is offline.", vm->get_cname(), dst_pm->get_cname());
+ if (not src_pm->is_on())
+ throw simgrid::VmFailureException(
+ XBT_THROW_POINT, simgrid::xbt::string_printf("Cannot migrate VM '%s' from host '%s', which is offline.",
+ vm->get_cname(), src_pm->get_cname()));
+ if (not dst_pm->is_on())
+ throw simgrid::VmFailureException(
+ XBT_THROW_POINT, simgrid::xbt::string_printf("Cannot migrate VM '%s' to host '%s', which is offline.",
+ vm->get_cname(), dst_pm->get_cname()));