/* Functions related to the Virtual Machines. */
-/* Copyright (c) 2012-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2012-2021. 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 "simgrid/Exception.hpp"
#include "simgrid/plugins/live_migration.h"
#include "src/kernel/context/Context.hpp"
-#include "src/plugins/vm/VirtualMachineImpl.hpp"
+#include "src/kernel/resource/VirtualMachineImpl.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
jvm_bind(env, jVm, vm);
jVm = env->NewGlobalRef(jVm);
// We use the extension level of the host, even if that's somehow disturbing
- vm->extension_set(JAVA_HOST_LEVEL, (void*)jVm);
+ vm->extension_set(JAVA_HOST_LEVEL, jVm);
}
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_VM_all(JNIEnv* env, jclass cls_arg)
for (size_t i = 0; i < host_count; i++) {
const auto* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(hosts[i]);
- if (vm != nullptr && vm->get_state() != simgrid::s4u::VirtualMachine::state::DESTROYED) {
+ if (vm != nullptr && vm->get_state() != simgrid::s4u::VirtualMachine::State::DESTROYED) {
auto jvm = static_cast<jobject>(vm->extension(JAVA_HOST_LEVEL));
vms.push_back(jvm);
}
sg_vm_t vm = jvm_get_native(env, jvm);
if (vm) {
sg_vm_destroy(vm);
- auto* vmList = &simgrid::vm::VirtualMachineImpl::allVms_;
+ auto* vmList = &simgrid::kernel::resource::VirtualMachineImpl::allVms_;
vmList->erase(std::remove(vmList->begin(), vmList->end(), vm), vmList->end());
}
}
sg_host_t host = jhost_get_native(env, jhost);
if (not simgrid::ForcefulKillException::try_n_catch([&vm, &host]() { sg_vm_migrate(vm, host); })) {
XBT_VERB("Caught exception during migration");
- jxbt_throw_host_failure(env, "during migration");
+ jxbt_throw_host_failure(env, " during migration");
}
}