/* Functions related to the Virtual Machines. */
-/* Copyright (c) 2012-2018. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2012-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. */
#include "jxbt_utilities.hpp"
#include "simgrid/Exception.hpp"
#include "simgrid/plugins/live_migration.h"
+#include "src/kernel/context/Context.hpp"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
{
msg_vm_t vm = jvm_get_native(env,jvm);
msg_host_t host = jhost_get_native(env, jhost);
- try {
- MSG_vm_migrate(vm,host);
- }
- catch(xbt_ex& e){
- XBT_VERB("CATCH EXCEPTION MIGRATION %s",e.what());
- jxbt_throw_host_failure(env, (char*)"during migration");
+ if (not simgrid::ForcefulKillException::try_n_catch([&vm, &host]() { MSG_vm_migrate(vm, host); })) {
+ XBT_VERB("Caught exception during migration");
+ jxbt_throw_host_failure(env, "during migration");
}
}