cmdline_fixed_string_t quit;
};
-static void cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
+static void cmd_quit_parsed(__rte_unused void *parsed_result,
struct cmdline *cl,
- __attribute__((unused)) void *data)
+ __rte_unused void *data)
{
channel_monitor_exit();
channel_manager_exit();
static void
cmd_show_vm_parsed(void *parsed_result, struct cmdline *cl,
- __attribute__((unused)) void *data)
+ __rte_unused void *data)
{
struct cmd_show_vm_result *res = parsed_result;
struct vm_info info;
static void
cmd_set_pcpu_parsed(void *parsed_result, struct cmdline *cl,
- __attribute__((unused)) void *data)
+ __rte_unused void *data)
{
struct cmd_set_pcpu_result *res = parsed_result;
static void
cmd_vm_op_parsed(void *parsed_result, struct cmdline *cl,
- __attribute__((unused)) void *data)
+ __rte_unused void *data)
{
struct cmd_vm_op_result *res = parsed_result;
};
static void
cmd_channels_op_parsed(void *parsed_result, struct cmdline *cl,
- __attribute__((unused)) void *data)
+ __rte_unused void *data)
{
unsigned num_channels = 0, channel_num, i;
int channels_added;
- unsigned channel_list[CHANNEL_CMDS_MAX_VM_CHANNELS];
+ unsigned int channel_list[RTE_MAX_LCORE];
char *token, *remaining, *tail_ptr;
struct cmd_channels_op_result *res = parsed_result;
if ((errno != 0) || tail_ptr == NULL || (*tail_ptr != '\0'))
break;
- if (channel_num == CHANNEL_CMDS_MAX_VM_CHANNELS) {
+ if (channel_num == RTE_MAX_LCORE) {
cmdline_printf(cl, "Channel number '%u' exceeds the maximum number "
"of allowable channels(%u) for VM '%s'\n", channel_num,
- CHANNEL_CMDS_MAX_VM_CHANNELS, res->vm_name);
+ RTE_MAX_LCORE, res->vm_name);
return;
}
channel_list[num_channels++] = channel_num;
},
};
+struct cmd_set_query_result {
+ cmdline_fixed_string_t set_query;
+ cmdline_fixed_string_t vm_name;
+ cmdline_fixed_string_t query_status;
+};
+
+static void
+cmd_set_query_parsed(void *parsed_result,
+ __rte_unused struct cmdline *cl,
+ __rte_unused void *data)
+{
+ struct cmd_set_query_result *res = parsed_result;
+
+ if (!strcmp(res->query_status, "enable")) {
+ if (set_query_status(res->vm_name, true) < 0)
+ cmdline_printf(cl, "Unable to allow query for VM '%s'\n",
+ res->vm_name);
+ } else if (!strcmp(res->query_status, "disable")) {
+ if (set_query_status(res->vm_name, false) < 0)
+ cmdline_printf(cl, "Unable to disallow query for VM '%s'\n",
+ res->vm_name);
+ }
+}
+
+cmdline_parse_token_string_t cmd_set_query =
+ TOKEN_STRING_INITIALIZER(struct cmd_set_query_result,
+ set_query, "set_query");
+cmdline_parse_token_string_t cmd_set_query_vm_name =
+ TOKEN_STRING_INITIALIZER(struct cmd_set_query_result,
+ vm_name, NULL);
+cmdline_parse_token_string_t cmd_set_query_status =
+ TOKEN_STRING_INITIALIZER(struct cmd_set_query_result,
+ query_status, "enable#disable");
+
+cmdline_parse_inst_t cmd_set_query_set = {
+ .f = cmd_set_query_parsed,
+ .data = NULL,
+ .help_str = "set_query <vm_name> <enable|disable>, allow or disallow queries"
+ " for the specified VM",
+ .tokens = {
+ (void *)&cmd_set_query,
+ (void *)&cmd_set_query_vm_name,
+ (void *)&cmd_set_query_status,
+ NULL,
+ },
+};
+
struct cmd_channels_status_op_result {
cmdline_fixed_string_t op;
cmdline_fixed_string_t vm_name;
static void
cmd_channels_status_op_parsed(void *parsed_result, struct cmdline *cl,
- __attribute__((unused)) void *data)
+ __rte_unused void *data)
{
unsigned num_channels = 0, channel_num;
int changed;
- unsigned channel_list[CHANNEL_CMDS_MAX_VM_CHANNELS];
+ unsigned int channel_list[RTE_MAX_LCORE];
char *token, *remaining, *tail_ptr;
struct cmd_channels_status_op_result *res = parsed_result;
enum channel_status status;
if ((errno != 0) || tail_ptr == NULL || (*tail_ptr != '\0'))
break;
- if (channel_num == CHANNEL_CMDS_MAX_VM_CHANNELS) {
+ if (channel_num == RTE_MAX_LCORE) {
cmdline_printf(cl, "%u exceeds the maximum number of allowable "
"channels(%u) for VM '%s'\n", channel_num,
- CHANNEL_CMDS_MAX_VM_CHANNELS, res->vm_name);
+ RTE_MAX_LCORE, res->vm_name);
return;
}
channel_list[num_channels++] = channel_num;
static void
cmd_show_cpu_freq_parsed(void *parsed_result, struct cmdline *cl,
- __attribute__((unused)) void *data)
+ __rte_unused void *data)
{
struct cmd_show_cpu_freq_result *res = parsed_result;
uint32_t curr_freq = power_manager_get_current_frequency(res->core_num);
static void
cmd_set_cpu_freq_parsed(void *parsed_result, struct cmdline *cl,
- __attribute__((unused)) void *data)
+ __rte_unused void *data)
{
int ret = -1;
struct cmd_set_cpu_freq_result *res = parsed_result;
(cmdline_parse_inst_t *)&cmd_show_cpu_freq_set,
(cmdline_parse_inst_t *)&cmd_set_cpu_freq_set,
(cmdline_parse_inst_t *)&cmd_set_pcpu_set,
+ (cmdline_parse_inst_t *)&cmd_set_query_set,
NULL,
};
void
-run_cli(__attribute__((unused)) void *arg)
+run_cli(__rte_unused void *arg)
{
struct cmdline *cl;