Beispiel #1
0
static void dump_platform_storages(void){
  unsigned int cursor;
  xbt_dynar_t storages = MSG_storages_as_dynar();
  msg_storage_t storage;
  xbt_dynar_foreach(storages, cursor, storage){
    XBT_INFO("Storage %s is attached to %s", MSG_storage_get_name(storage), MSG_storage_get_host(storage));
    MSG_storage_set_property_value(storage, "other usage", xbt_strdup("gpfs"));
  }
Beispiel #2
0
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Storage_setProperty(JNIEnv *env, jobject jstorage, jobject jname, jobject jvalue) {
  msg_storage_t storage = jstorage_get_native(env, jstorage);

  if (!storage) {
    jxbt_throw_notbound(env, "storage", jstorage);
    return;
  }
  const char *name = env->GetStringUTFChars((jstring) jname, 0);
  const char *value_java = env->GetStringUTFChars((jstring) jvalue, 0);
  char *value = xbt_strdup(value_java);

  MSG_storage_set_property_value(storage, name, value, xbt_free_f);

  env->ReleaseStringUTFChars((jstring) jvalue, value_java);
  env->ReleaseStringUTFChars((jstring) jname, name);

}