Changeset 5b320ac in mainline for uspace/app
- Timestamp:
- 2024-11-22T18:38:49Z (15 months ago)
- Children:
- d0f0744
- Parents:
- 06f2762
- File:
-
- 1 edited
-
uspace/app/hrctl/hrctl.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/hrctl/hrctl.c
r06f2762 r5b320ac 69 69 " -4 parity on one extent\n" 70 70 " -5 distributed parity\n" 71 " -H, --hotspare=DEV add hotspare extent\n" 71 72 "\n" 72 73 "When specifying name for creation or assembly, the device name\n" … … 80 81 " - assembles RAID device named /hr0 consisting of 2 drives,\n" 81 82 " that were previously in an array\n" 83 " hrctl devices/hr0 --hotspare=devices/disk10\n" 84 " - adds \"devices/disk10\" as hotspare extent\n" 82 85 "Limitations:\n" 83 86 " - device name must be less than 32 characters in size\n"; … … 93 96 { "destroy", required_argument, 0, 'D' }, 94 97 { "fail-extent", required_argument, 0, 'F' }, 98 { "hotspare", required_argument, 0, 'H' }, 95 99 { 0, 0, 0, 0 } 96 100 }; … … 247 251 248 252 while (c != -1) { 249 c = getopt_long(argc, argv, "hsC:c:A:a:l:0145Ln:D:F: ",253 c = getopt_long(argc, argv, "hsC:c:A:a:l:0145Ln:D:F:H:", 250 254 long_options, NULL); 251 255 switch (c) { … … 345 349 } 346 350 break; 351 case 'H': 352 if (optind != 3 && argc != 4) 353 goto bad; 354 355 service_id_t hotspare; 356 service_id_t vol_svc_id; 357 358 rc = loc_service_get_id(argv[1], &vol_svc_id, 0); 359 if (rc != EOK) { 360 printf("hrctl: error resolving volume \"%s\", " 361 "aborting extent addition\n", argv[1]); 362 goto bad; 363 } 364 365 rc = loc_service_get_id(optarg, &hotspare, 0); 366 if (rc != EOK) { 367 printf("hrctl: error resolving device \"%s\", " 368 "aborting extent addition\n", optarg); 369 goto bad; 370 } 371 372 rc = hr_add_hotspare(vol_svc_id, hotspare); 373 if (rc != EOK) 374 printf("hrctl: hr_add_hotspare() rc: %s\n", 375 str_error(rc)); 376 377 free(cfg); 378 if (rc != EOK) 379 return 1; 380 else 381 return 0; 347 382 } 348 383 }
Note:
See TracChangeset
for help on using the changeset viewer.
