/* * Get all the BaseServer Instances from the wbem base server factory. */ cli::framework::ResultBase * cli::nvmcli::NamespaceFeature::run( const int &commandSpecId, const framework::ParsedCommand& parsedCommand) { LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); framework::ResultBase *pResult = NULL; switch (commandSpecId) { case SHOW_CONFIG_GOAL: pResult = showConfigGoal(parsedCommand); break; case DELETE_CONFIG_GOAL: pResult = deleteConfigGoal(parsedCommand); break; case CREATE_GOAL: pResult = createGoal(parsedCommand); break; case SHOW_POOLS: pResult = showPools(parsedCommand); break; case DUMP_CONFIG: pResult = dumpConfig(parsedCommand); break; case LOAD_CONFIG_GOAL: pResult = loadGoal(parsedCommand); break; case SHOW_NAMESPACE: pResult = showNamespaces(parsedCommand); break; case DELETE_NAMESPACE: pResult = deleteNamespaces(parsedCommand); break; case CREATE_NAMESPACE: pResult = createNamespace(parsedCommand); break; case MODIFY_NAMESPACE: pResult = modifyNamespace(parsedCommand); break; default: pResult = new framework::NotImplementedErrorResult(commandSpecId, Name); break; } return pResult; }
int main (int argc, const char * const argv[]) { char buf[BUFSIZE]; apr_size_t nRead, nWrite; apr_file_t *f_stdin; apr_file_t *f_stdout; apr_getopt_t *opt; apr_status_t rv; char c; const char *opt_arg; const char *err = NULL; #if APR_FILES_AS_SOCKETS apr_pollfd_t pollfd = { 0 }; apr_status_t pollret = APR_SUCCESS; int polltimeout; #endif apr_app_initialize(&argc, &argv, NULL); atexit(apr_terminate); memset(&config, 0, sizeof config); memset(&status, 0, sizeof status); status.rotateReason = ROTATE_NONE; apr_pool_create(&status.pool, NULL); apr_getopt_init(&opt, status.pool, argc, argv); #if APR_FILES_AS_SOCKETS while ((rv = apr_getopt(opt, "lL:p:ftvecn:", &c, &opt_arg)) == APR_SUCCESS) { #else while ((rv = apr_getopt(opt, "lL:p:ftven:", &c, &opt_arg)) == APR_SUCCESS) { #endif switch (c) { case 'l': config.use_localtime = 1; break; case 'L': config.linkfile = opt_arg; break; case 'p': config.postrotate_prog = opt_arg; break; case 'f': config.force_open = 1; break; case 't': config.truncate = 1; break; case 'v': config.verbose = 1; break; case 'e': config.echo = 1; break; #if APR_FILES_AS_SOCKETS case 'c': config.create_empty = 1; break; #endif case 'n': config.num_files = atoi(opt_arg); status.fileNum = -1; break; } } if (rv != APR_EOF) { usage(argv[0], NULL /* specific error message already issued */ ); } /* * After the initial flags we need 2 to 4 arguments, * the file name, either the rotation interval time or size * or both of them, and optionally the UTC offset. */ if ((argc - opt->ind < 2) || (argc - opt->ind > 4) ) { usage(argv[0], "Incorrect number of arguments"); } config.szLogRoot = argv[opt->ind++]; /* Read in the remaining flags, namely time, size and UTC offset. */ for(; opt->ind < argc; opt->ind++) { if ((err = get_time_or_size(&config, argv[opt->ind], opt->ind < argc - 1 ? 0 : 1)) != NULL) { usage(argv[0], err); } } config.use_strftime = (strchr(config.szLogRoot, '%') != NULL); if (config.use_strftime && config.num_files > 0) { fprintf(stderr, "Cannot use -n with %% in filename\n"); exit(1); } if (status.fileNum == -1 && config.num_files < 1) { fprintf(stderr, "Invalid -n argument\n"); exit(1); } if (apr_file_open_stdin(&f_stdin, status.pool) != APR_SUCCESS) { fprintf(stderr, "Unable to open stdin\n"); exit(1); } if (apr_file_open_stdout(&f_stdout, status.pool) != APR_SUCCESS) { fprintf(stderr, "Unable to open stdout\n"); exit(1); } /* * Write out result of config parsing if verbose is set. */ if (config.verbose) { dumpConfig(&config); } #if APR_FILES_AS_SOCKETS if (config.create_empty && config.tRotation) { pollfd.p = status.pool; pollfd.desc_type = APR_POLL_FILE; pollfd.reqevents = APR_POLLIN; pollfd.desc.f = f_stdin; } #endif /* * Immediately open the logfile as we start, if we were forced * to do so via '-f'. */ if (config.force_open) { doRotate(&config, &status); } for (;;) { nRead = sizeof(buf); #if APR_FILES_AS_SOCKETS if (config.create_empty && config.tRotation) { polltimeout = status.tLogEnd ? status.tLogEnd - get_now(&config) : config.tRotation; if (polltimeout <= 0) { pollret = APR_TIMEUP; } else { pollret = apr_poll(&pollfd, 1, &pollret, apr_time_from_sec(polltimeout)); } } if (pollret == APR_SUCCESS) { rv = apr_file_read(f_stdin, buf, &nRead); if (APR_STATUS_IS_EOF(rv)) { break; } else if (rv != APR_SUCCESS) { exit(3); } } else if (pollret == APR_TIMEUP) { *buf = 0; nRead = 0; } else { fprintf(stderr, "Unable to poll stdin\n"); exit(5); } #else /* APR_FILES_AS_SOCKETS */ rv = apr_file_read(f_stdin, buf, &nRead); if (APR_STATUS_IS_EOF(rv)) { break; } else if (rv != APR_SUCCESS) { exit(3); } #endif /* APR_FILES_AS_SOCKETS */ checkRotate(&config, &status); if (status.rotateReason != ROTATE_NONE) { doRotate(&config, &status); } nWrite = nRead; rv = apr_file_write_full(status.current.fd, buf, nWrite, &nWrite); if (nWrite != nRead) { apr_off_t cur_offset; cur_offset = 0; if (apr_file_seek(status.current.fd, APR_CUR, &cur_offset) != APR_SUCCESS) { cur_offset = -1; } status.nMessCount++; apr_snprintf(status.errbuf, sizeof status.errbuf, "Error %d writing to log file at offset %" APR_OFF_T_FMT ". " "%10d messages lost (%pm)\n", rv, cur_offset, status.nMessCount, &rv); truncate_and_write_error(&status); } else { status.nMessCount++; } if (config.echo) { if (apr_file_write_full(f_stdout, buf, nRead, &nWrite)) { fprintf(stderr, "Unable to write to stdout\n"); exit(4); } } } return 0; /* reached only at stdin EOF. */ }
void fsDebugMgr::checkSpecialCommand() { u8 cmd_no = 0; if (fsInputMgr::isOn(fsInputMgr::KEY_D)) { if (fsInputMgr::isPressed(fsInputMgr::KEY_1)) { cmd_no = 1; } else if (fsInputMgr::isPressed(fsInputMgr::KEY_2)) { cmd_no = 2; } else if (fsInputMgr::isPressed(fsInputMgr::KEY_3)) { cmd_no = 3; } else if (fsInputMgr::isPressed(fsInputMgr::KEY_4)) { cmd_no = 4; } else if (fsInputMgr::isPressed(fsInputMgr::KEY_5)) { cmd_no = 5; } else if (fsInputMgr::isPressed(fsInputMgr::KEY_6)) { cmd_no = 6; } else if (fsInputMgr::isPressed(fsInputMgr::KEY_7)) { cmd_no = 7; } else if (fsInputMgr::isPressed(fsInputMgr::KEY_8)) { cmd_no = 8; } else if (fsInputMgr::isPressed(fsInputMgr::KEY_PAGEUP)) { cmd_no = 100; } else if (fsInputMgr::isPressed(fsInputMgr::KEY_PAGEDOWN)) { cmd_no = 101; } } if (fsInputMgr::isPressed(fsInputMgr::KEY_LBUTTON)) { r32 mouse_x = m_dbg_mode_scr->framebufferXToScreenX(fsInputMgr::getMouseX()); r32 mouse_y = m_dbg_mode_scr->framebufferYToScreenY(fsInputMgr::getMouseY()); if (mouse_x > 0.0f && mouse_y > 0.0f) { if (m_dbg_mode_tap_cntr < 2) { m_dbg_mode_tap_cntr++; } else if (m_dbg_mode_tap_cntr > 2) { m_dbg_mode_tap_cntr = 1; } } else if ((m_dbg_mode_tap_cntr >= 2 && m_dbg_mode_tap_cntr <= 3 && mouse_x < 0.0f && mouse_y > 0.0f) || // (m_dbg_mode_tap_cntr >= 4 && m_dbg_mode_tap_cntr <= 5 && mouse_x < 0.0f && mouse_y < 0.0f) || // (m_dbg_mode_tap_cntr >= 6 && m_dbg_mode_tap_cntr <= 7 && mouse_x > 0.0f && mouse_y < 0.0f)) { m_dbg_mode_tap_cntr++; } else { m_dbg_mode_tap_cntr = 0; } if (m_dbg_mode_tap_cntr == 8) { cmd_no = 1; m_dbg_mode_tap_cntr = 0; m_dbg_dump_tap_cntr = 0; m_scroll_hold_cntr = 0; } if (m_dbg_mode.getType() == MODE_CONSOLE) { if (mouse_x > 0.0f && mouse_y > 0.0f) { if (m_dbg_dump_tap_cntr >= 3 && m_dbg_dump_tap_cntr < 100) { cmd_no = m_dbg_dump_tap_cntr - 1; m_dbg_mode_tap_cntr = 0; m_scroll_hold_cntr = 0; } m_dbg_dump_tap_cntr = 1; } else if (mouse_x < 0.0f && mouse_y < 0.0f) { m_dbg_dump_tap_cntr++; } else { m_dbg_dump_tap_cntr = 0; } } } if (m_dbg_mode.getType() == MODE_CONSOLE) { r32 mouse_y = m_dbg_mode_scr->framebufferYToScreenY(fsInputMgr::getMouseY()); if (fsInputMgr::isOn(fsInputMgr::KEY_LBUTTON)) { if (mouse_y > 0.0f) { m_scroll_hold_cntr++; } else { m_scroll_hold_cntr--; } if (fsMath::abs(m_scroll_hold_cntr) >= fsTaskMgr::getAimFPS()) { cmd_no = (m_scroll_hold_cntr > 0) ? 100 : 101; m_dbg_mode_tap_cntr = 0; m_dbg_dump_tap_cntr = 0; m_scroll_hold_cntr = 0; } } else { m_scroll_hold_cntr = 0; } } switch (cmd_no) { case 1: if (m_dbg_mode.getType() == MODE_OFF) { setDebugMode(MODE_MONITOR); } else if (m_dbg_mode.getType() == MODE_MONITOR) { setDebugMode(MODE_CONSOLE); } else { setDebugMode(MODE_OFF); } break; case 2: dumpMemory(); break; case 3: dumpTask(); break; case 4: dumpResource(); break; case 5: dumpConfig(); break; case 6: dumpScreen(); break; case 7: dumpTexture(); break; case 8: dumpShader(); break; case 100: pageUpConsole(); break; case 101: pageDownConsole(); break; default: break; } }
bool initializeEgl(int width, int height, const EGLint* configAttrs, const EGLint* contextAttrs) { EGLint configCount = 0; #if defined(HAVE_LIBOSSO) ossoContext = osso_initialize("com.nokia.memperf", "1.0", FALSE, NULL); if (!ossoContext) { printf("Warning: osso_initialize failed\n"); } #endif ctx.dpy = eglGetDisplay(ctx.nativeDisplay); ASSERT_EGL(); eglInitialize(ctx.dpy, NULL, NULL); eglChooseConfig(ctx.dpy, configAttrs, &ctx.config, 1, &configCount); ASSERT_EGL(); if (!configCount) { printf("Config not found\n"); goto out_error; } if (options.verbose) { printf("Config attributes:\n"); dumpConfig(ctx.dpy, ctx.config); } if (!nativeCreateWindow(ctx.nativeDisplay, ctx.dpy, ctx.config, __FILE__, width, height, &ctx.win)) { printf("Unable to create a window\n"); goto out_error; } ctx.context = eglCreateContext(ctx.dpy, ctx.config, EGL_NO_CONTEXT, contextAttrs); ASSERT_EGL(); if (!ctx.context) { printf("Unable to create a context\n"); goto out_error; } ctx.surface = eglCreateWindowSurface(ctx.dpy, ctx.config, ctx.win, NULL); ASSERT_EGL(); if (!ctx.surface) { printf("Unable to create a surface\n"); goto out_error; } eglMakeCurrent(ctx.dpy, ctx.surface, ctx.surface, ctx.context); ASSERT_EGL(); eglSwapInterval(ctx.dpy, 0); return true; out_error: eglMakeCurrent(ctx.dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroySurface(ctx.dpy, ctx.surface); eglDestroyContext(ctx.dpy, ctx.context); eglTerminate(ctx.dpy); nativeDestroyWindow(ctx.nativeDisplay, ctx.win); nativeDestroyDisplay(ctx.nativeDisplay); return false; }
/* * Command Specs the Example Feature supports */ void cli::nvmcli::NamespaceFeature::getPaths(cli::framework::CommandSpecList &list) { cli::framework::CommandSpec deleteConfigGoal(DELETE_CONFIG_GOAL, TR("Delete Memory Allocation Goal"), framework::VERB_DELETE, TR("Delete the memory allocation goal from one or more " NVM_DIMM_NAME "s.")); deleteConfigGoal.addTarget(TARGET_DIMM.name, false, DIMMIDS_STR, true, TR("Delete the memory allocation goal from specific " NVM_DIMM_NAME "s by supplying one or more " "comma separated " NVM_DIMM_NAME " identifiers. The default is to delete the " "memory allocation goals from all manageable " NVM_DIMM_NAME "s.")); deleteConfigGoal.addTarget(TARGET_GOAL_R); deleteConfigGoal.addTarget(TARGET_SOCKET.name, false, SOCKETIDS_STR, true, TR("Delete the memory allocation goal from the " NVM_DIMM_NAME "s on specific sockets " "by supplying the socket target and one or more comma-separated socket identifiers. " "The default is to delete the memory allocation goals from all manageable " NVM_DIMM_NAME "s on all sockets.")); cli::framework::CommandSpec showConfigGoal(SHOW_CONFIG_GOAL, TR("Show Memory Allocation Goal"), framework::VERB_SHOW, TR("Show the memory allocation goal on one or more " NVM_DIMM_NAME "s. Once the goal is successfully applied " "by the BIOS, it is no longer displayed.")); showConfigGoal.addOption(framework::OPTION_ALL); showConfigGoal.addOption(framework::OPTION_DISPLAY); showConfigGoal.addTarget(TARGET_DIMM.name, false, DIMMIDS_STR, true, TR("Restrict output to specific " NVM_DIMM_NAME "s by supplying one or more comma-separated " NVM_DIMM_NAME " " "identifiers. The default is to display all manageable " NVM_DIMM_NAME "s with memory allocation goals.")); showConfigGoal.addTarget(TARGET_GOAL_R).isValueAccepted(false); showConfigGoal.addTarget(TARGET_SOCKET.name, false, SOCKETIDS_STR, true, TR("Restrict output to the " NVM_DIMM_NAME "s on specific sockets by supplying the socket target and " "one or more comma-separated socket identifiers. The default is to display all " "manageable " NVM_DIMM_NAME "s on all sockets with memory allocation goals.")); framework::CommandSpec createGoal(CREATE_GOAL, TR("Create Memory Allocation Goal"), framework::VERB_CREATE, TR("Create a memory allocation goal on one or more " NVM_DIMM_NAME "s. " "This operation stores the specified goal on the " NVM_DIMM_NAME "(s) for the BIOS to " "read on the next reboot in order to map the " NVM_DIMM_NAME " capacity into the system " "address space.")); createGoal.addOption(framework::OPTION_FORCE).helpText(TR("Reconfiguring " NVM_DIMM_NAME "s is a destructive operation " "which requires confirmation from the user. This option suppresses the confirmation."));; createGoal.addTarget(TARGET_DIMM) .isValueRequired(true) .helpText(TR("Create a memory allocation goal on specific " NVM_DIMM_NAME "s by " "supplying one or more comma-separated " NVM_DIMM_NAME " identifiers. " "This list must include all unconfigured " NVM_DIMM_NAME "s on the affected socket(s). " "The default is to configure all manageable " NVM_DIMM_NAME "s on all sockets.")); createGoal.addTarget(TARGET_SOCKET) .isValueRequired(true) .helpText(TR("Create a memory allocation goal on the " NVM_DIMM_NAME "s on specific sockets by supplying the " "socket target and one or more comma-separated socket identifiers. The default is " "to configure all manageable " NVM_DIMM_NAME "s on all sockets.")); createGoal.addTarget(TARGET_GOAL_R); createGoal.addProperty(MEMORYSIZE_PROPERTYNAME).isValueRequired(true) .valueText("GiB") .helpText(TR("Gibibytes of the requested " NVM_DIMM_NAME "s' capacity to use in Memory Mode or \"Remaining\" " "if all remaining unconfigured space is desired. Must be a multiple of the memory alignment " "size defined in Show System Capabilities.")); createGoal.addProperty(APPDIRECTSIZE_PROPERTYNAME).isValueRequired(true) .valueText("GiB") .helpText(TR(APPDIRECT1SIZE_PROPERTYDESC.c_str())); createGoal.addProperty(APPDIRECTSETTINGS_PROPERTYNAME).isValueRequired(true) .valueText("value") .helpText(TR(APPDIRECT1SETTING_PROPERTYDESC.c_str())); createGoal.addProperty(APPDIRECT1SIZE_PROPERTYNAME).isValueRequired(true) .valueText("GiB") .helpText(TR(APPDIRECT1SIZE_PROPERTYDESC.c_str())); createGoal.addProperty(APPDIRECT1SETTINGS_PROPERTYNAME).isValueRequired(true) .valueText("value") .helpText(TR(APPDIRECT1SETTING_PROPERTYDESC.c_str())); createGoal.addProperty(APPDIRECT2SIZE_PROPERTYNAME).isValueRequired(true) .valueText("GiB") .helpText(TR(APPDIRECT2SIZE_PROPERTYDESC.c_str())); createGoal.addProperty(APPDIRECT2SETTINGS_PROPERTYNAME).isValueRequired(true) .valueText("value") .helpText(TR(APPDIRECT2SETTING_PROPERTYDESC.c_str())); createGoal.addProperty(RESERVEDIMM_PROPERTYNAME) .isValueRequired(true) .valueText("0|1") .helpText(TRS(RESERVEDIMM_PROPERTYDESC)); createGoal.addProperty(STORAGECAPACITY_PROPERTYNAME) .isValueRequired(true) .valueText("Remaining") .helpText(TRS(STORAGECAPACITY_PROPERTYDESC)); cli::framework::CommandSpec showNamespace(SHOW_NAMESPACE, TR("Show Namespace"), framework::VERB_SHOW, TR("Show information about one or more namespaces.")); showNamespace.addOption(framework::OPTION_ALL); showNamespace.addOption(framework::OPTION_DISPLAY); showNamespace.addOption(framework::OPTION_UNITS).helpText(TR(NS_UNITS_OPTION_DESC.c_str())); showNamespace.addTarget(TARGET_NAMESPACE_R) .helpText(TR("Restrict output to specific namespaces by providing a comma separated list " "of one or more namespace identifiers. The default is to display all namespaces.")); showNamespace.addTarget(TARGET_POOL) .isValueRequired(true) .helpText(TR("Restrict output to the namespaces on specific pools by supplying the pool " "target and one or more comma-separated pool identifiers. The default is to " "display namespaces on all pools.")); showNamespace.addProperty(wbem::TYPE_KEY, false, wbem::pmem_config::NS_TYPE_STR_UNKNOWN + "|" + wbem::pmem_config::NS_TYPE_STR_APPDIRECT + "|" + wbem::pmem_config::NS_TYPE_STR_STORAGE, true, TR("Restrict output to namespaces of a specific type by supplying the Type property " "with the desired namespace type. The default is to display every type of namespace.")); showNamespace.addProperty(wbem::HEALTHSTATE_KEY, false, wbem::pmem_config::NS_HEALTH_STR_UNKNOWN + "|" + wbem::pmem_config::NS_HEALTH_STR_NORMAL + "|" + wbem::pmem_config::NS_HEALTH_STR_WARN + "|" + wbem::pmem_config::NS_HEALTH_STR_ERR + "|" + wbem::pmem_config::NS_HEALTH_STR_BROKENMIRROR, true, TR("Restrict output to namespaces with a specific health state by supplying the " "HealthState property with the desired health state. The default is to display " "namespaces in every state.")); cli::framework::CommandSpec createNamespace(CREATE_NAMESPACE, TR("Create Namespace"), framework::VERB_CREATE, TR("Create a new namespace from a persistent memory pool of " NVM_DIMM_NAME " capacity.")); createNamespace.addOption(framework::OPTION_FORCE); createNamespace.addOption(framework::OPTION_UNITS).helpText(TR(NS_UNITS_OPTION_DESC.c_str())); createNamespace.addTarget(TARGET_NAMESPACE_R) .valueText("") .isValueAccepted(false) .helpText(TR("Create a new namespace. No filtering is supported on this target.")); createNamespace.addTarget(TARGET_POOL).isValueRequired(false) .helpText(TR("The pool identifier on which to create the namespace.")); createNamespace.addProperty(CREATE_NS_PROP_TYPE, true, "AppDirect|Storage", true, TR("The type of namespace to be created.")); createNamespace.addProperty(CREATE_NS_PROP_BLOCKSIZE, false, "size", true, TR("The logical size in bytes for read/write operations. Must be one of the supported " "block sizes retrieved using the Show System Capabilities command.")); createNamespace.addProperty(CREATE_NS_PROP_BLOCKCOUNT, false, "count", true, TR("The total number of blocks of memory that make up the namespace (BlockCount x BlockSize = Capacity).")); createNamespace.addProperty(CREATE_NS_PROP_FRIENDLYNAME, false, "string", true, TR("Optional user specified namespace name to more easily identify the namespace. Up to a maximum of 64 " "characters.")); createNamespace.addProperty(CREATE_NS_PROP_OPTIMIZE, false, "CopyOnWrite|None", true, TR("If the namespace has CopyOnWrite optimization turned on after creation.")); createNamespace.addProperty(CREATE_NS_PROP_ENABLED, false, "0|1|False|True", true, TR("Enable or disable the namespace after creation. " "A disabled namespace is hidden from the OS by the driver.")); createNamespace.addProperty(CREATE_NS_PROP_ENCRYPTION, false, "0|1|False|True", true, TR("If the namespace has Encryption turned on after creation.")); createNamespace.addProperty(CREATE_NS_PROP_ERASECAPABLE, false, "0|1|False|True", true, TR("If the namespace supports erase capability after creation.")); createNamespace.addProperty(APPDIRECTSETTINGS_PROPERTYNAME, false, "value", true, TR("Create the namespace on persistent memory matching the " "specified quality of service attributes. Only applicable if the " "type is App Direct.")); createNamespace.addProperty(CREATE_NS_PROP_CAPACITY, false, "capacity", true, TR("The size of the namespace in GB. Capacity and BlockCount are exclusive " "and therefore cannot be used together. Note: Capacity can only be provided " "as decimal gigabytes and not gibibytes (e.g. 16.7 GB vs 16 GiB).")); cli::framework::CommandSpec modifyNamespace(MODIFY_NAMESPACE, TR("Modify Namespace"), framework::VERB_SET, TR("Modify one or more existing namespaces.")); modifyNamespace.addOption(framework::OPTION_FORCE); modifyNamespace.addTarget(TARGET_NAMESPACE_R).helpText(TR("Modify the settings on specific namespaces by " "providing comma separated list of one or more namespace identifiers. The default is to modify all namespaces.")); modifyNamespace.addProperty(CREATE_NS_PROP_FRIENDLYNAME, false, "string", true, TR("Change the user specified namespace name up to a maximum of 64 characters.")); modifyNamespace.addProperty("BlockCount", false, "count", true, TR("Change the total number of blocks of memory that make up in the namespace " "(BlockCount x BlockSize = Capacity).")); modifyNamespace.addProperty(CREATE_NS_PROP_ENABLED, false, "0|1", true, TR("Enable or disable the namespace. A disabled namespace is hidden from the OS by the " "driver.")); modifyNamespace.addProperty(CREATE_NS_PROP_CAPACITY, false, "capacity", true, TR("Change the size of the namespace.")); cli::framework::CommandSpec deleteNamespace(DELETE_NAMESPACE, TR("Delete Namespace"), framework::VERB_DELETE, TR("Delete one or more existing namespaces. All data on the deleted namespace(s) becomes " "inaccessible.")); deleteNamespace.addOption(framework::OPTION_FORCE); deleteNamespace.addTarget(TARGET_NAMESPACE_R).helpText(TR("Delete specific namespaces by providing " "a comma separated list of one or more namespace identifiers. The default is to " "delete all namespaces.")); framework::CommandSpec showPools(SHOW_POOLS, TR("Show Persistent Memory"), framework::VERB_SHOW, TR("Retrieve a list of persistent memory pools of " NVM_DIMM_NAME " capacity.")); showPools.addOption(framework::OPTION_DISPLAY); showPools.addOption(framework::OPTION_ALL); showPools.addOption(framework::OPTION_UNITS).helpText(TR("Change the units the pool capacities are displayed in.")); showPools.addTarget(TARGET_POOL_R).helpText(TR("Restrict output to specific persistent " "memory pools by providing one or more comma-separated pool identifiers. " "The default is to display the persistent memory pools across all " "manageable " NVM_DIMM_NAME "s.")); showPools.addTarget(TARGET_SOCKET).helpText(TR("Restrict output to the persistent memory " "pools on specific sockets by supplying the socket target and one or more " "comma-separated socket identifiers. The default is to display all sockets.")); framework::CommandSpec dumpConfig(DUMP_CONFIG, TR("Dump Memory Allocation Settings"), framework::VERB_DUMP, TR("Store the currently configured memory allocation settings for all " NVM_DIMM_NAME "s in the " "system to a file in order to replicate the configuration elsewhere. Apply the stored " "memory allocation settings using the Load Memory Allocation Goal command.")); dumpConfig.addOption(framework::OPTION_DESTINATION_R).helpText(TR("The file path in which to store " "the memory allocation settings. The resulting file will contain the memory allocation settings " "for all configured " NVM_DIMM_NAME "s in the system.")); dumpConfig.addTarget(TARGET_SYSTEM_R).helpText(TR("The host system.")) .isValueAccepted(false); dumpConfig.addTarget(TARGET_CONFIG_R).helpText(TR("The current " NVM_DIMM_NAME " memory allocation settings.")) .isValueAccepted(false); framework::CommandSpec loadGoal(LOAD_CONFIG_GOAL, TR("Load Memory Allocation Goal"), framework::VERB_LOAD, TR("Load a memory allocation goal from a file onto one or more " NVM_DIMM_NAME "s.")); loadGoal.addOption(framework::OPTION_FORCE).helpText(TR("Reconfiguring " NVM_DIMM_NAME "s is a destructive operation " "which requires confirmation from the user. This option suppresses the confirmation.")); loadGoal.addOption(framework::OPTION_SOURCE_R).helpText(TR("File path of the stored configuration " "settings to load as a memory allocation goal.")); loadGoal.addTarget(TARGET_GOAL_R).isValueAccepted(false); loadGoal.addTarget(TARGET_DIMM) .helpText(TR("Load the memory allocation goal to specific " NVM_DIMM_NAME "s " "by supplying one or more comma-separated " NVM_DIMM_NAME " identifiers. The default is to load the " "memory allocation goal onto all manageable " NVM_DIMM_NAME "s.")) .isValueRequired(true); loadGoal.addTarget(TARGET_SOCKET).helpText(TR("Load the memory allocation goal onto all manageable " NVM_DIMM_NAME "s on " "specific sockets by supplying the socket target and one or more comma-separated socket identifiers. " "The default is to load the memory allocation goal onto all manageable " NVM_DIMM_NAME "s on all sockets.")); list.push_back(showNamespace); list.push_back(createNamespace); list.push_back(modifyNamespace); list.push_back(deleteNamespace); list.push_back(showConfigGoal); list.push_back(deleteConfigGoal); list.push_back(createGoal); list.push_back(showPools); list.push_back(dumpConfig); list.push_back(loadGoal); }