/* Functions related to the Virtual Machines. */
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2012-2018. 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 "jmsg_vm.h"
#include "jmsg_host.h"
#include "jxbt_utilities.hpp"
+#include "simgrid/Exception.hpp"
#include "simgrid/plugins/live_migration.h"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
-#include "xbt/ex.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-extern "C" {
-
extern int JAVA_HOST_LEVEL;
static jfieldID jvm_field_bind;
msg_host_t h;
xbt_dynar_foreach (hosts, it, h) {
simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(h);
- if (vm != nullptr && vm->getState() != SURF_VM_STATE_DESTROYED) {
+ if (vm != nullptr && vm->get_state() != simgrid::s4u::VirtualMachine::state::DESTROYED) {
jobject jvm = static_cast<jobject>(vm->extension(JAVA_HOST_LEVEL));
vms.push_back(jvm);
}
msg_vm_t vm = jvm_get_native(env, jvm);
if (vm) {
MSG_vm_destroy(vm);
- auto vmList = &simgrid::vm::VirtualMachineImpl::allVms_;
+ auto* vmList = &simgrid::vm::VirtualMachineImpl::allVms_;
vmList->erase(std::remove(vmList->begin(), vmList->end(), vm), vmList->end());
}
}
return static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
}
-}