Changeset cf28ffd3 in mainline for uspace/app/hrctl/hrctl.c


Ignore:
Timestamp:
2024-10-28T22:19:45Z (9 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
1cfa162
Parents:
d84773a
Message:

hr: add option to silently fail an extent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/hrctl/hrctl.c

    rd84773a rcf28ffd3  
    5959    "  -s, --status              display status of active arrays\n"
    6060    "  -T, --stop                stop an active array\n"
     61    "  -F, --fail-extent         fail an extent, use with -T and set it before\n"
    6162    "  -c, --create=NAME         create new array\n"
    6263    "  -a, --assemble=NAME       assemble an existing array\n"
     
    8889        { "assemble-file", required_argument, 0, 'A' },
    8990        { "stop", required_argument, 0, 'T' },
     91        { "fail-extent", required_argument, 0, 'F' },
    9092        { 0, 0, 0, 0 }
    9193};
     
    220222        int retval, c;
    221223        bool create, assemble;
     224        long fail_extent = -1;
    222225        hr_t *hr;
    223226        hr_config_t *cfg;
     
    241244
    242245        while (c != -1) {
    243                 c = getopt_long(argc, argv, "hsC:c:A:a:l:0145Ln:T:",
     246                c = getopt_long(argc, argv, "hsC:c:A:a:l:0145Ln:T:F:",
    244247                    long_options, NULL);
    245248                switch (c) {
     
    286289                        break;
    287290                case 'T':
    288                         rc = hr_stop(optarg);
     291                        rc = hr_stop(optarg, fail_extent);
    289292                        free(cfg);
    290293                        if (rc != EOK) {
     
    295298                        }
    296299                        return 0;
     300                case 'F':
     301                        fail_extent = strtol(optarg, NULL, 10);
     302                        break;
    297303                case 'l':
    298304                        if (cfg->level != HR_LVL_UNKNOWN)
Note: See TracChangeset for help on using the changeset viewer.