| 341 | " cpu <cpu_id>\n"; |
| 342 | |
| 343 | static void |
| 344 | cmd_swq(char **tokens, |
| 345 | uint32_t n_tokens, |
| 346 | char *out, |
| 347 | size_t out_size) |
| 348 | { |
| 349 | struct swq_params p; |
| 350 | char *name; |
| 351 | struct swq *swq; |
| 352 | |
| 353 | if (n_tokens != 6) { |
| 354 | snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); |
| 355 | return; |
| 356 | } |
| 357 | |
| 358 | name = tokens[1]; |
| 359 | |
| 360 | if (strcmp(tokens[2], "size") != 0) { |
| 361 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "size"); |
| 362 | return; |
| 363 | } |
| 364 | |
| 365 | if (parser_read_uint32(&p.size, tokens[3]) != 0) { |
| 366 | snprintf(out, out_size, MSG_ARG_INVALID, "size"); |
| 367 | return; |
| 368 | } |
| 369 | |
| 370 | if (strcmp(tokens[4], "cpu") != 0) { |
| 371 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "cpu"); |
| 372 | return; |
| 373 | } |
| 374 | |
| 375 | if (parser_read_uint32(&p.cpu_id, tokens[5]) != 0) { |
| 376 | snprintf(out, out_size, MSG_ARG_INVALID, "cpu_id"); |
| 377 | return; |
| 378 | } |
| 379 | |
| 380 | swq = swq_create(name, &p); |
| 381 | if (swq == NULL) { |
| 382 | snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]); |
| 383 | return; |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | static const char cmd_tmgr_subport_profile_help[] = |
| 388 | "tmgr subport profile\n" |
no test coverage detected