Ignore:
Timestamp:
Mar 30, 2012, 2:43:01 AM (12 years ago)
Author:
Bruno Cornec
Message:

r4605@localhost: bruno | 2012-03-29 15:44:39 +0200

  • change create_raidtab_from_mdstat and parse_mdstat to have an additional parameter being the location of the /proc/mdstat file
  • adds a mkraidtab CLI parameter to test raidtab generation, allowed by the previous feature
  • cleanup libmondo-raid.c parse_mdstat function with correct indentation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/mondorestore/mondo-rstr-tools.c

    r2950 r2982  
    23482348
    23492349
    2350 void wait_until_software_raids_are_prepped(char *mdstat_file,
    2351                                            int wait_for_percentage)
     2350void wait_until_software_raids_are_prepped(char *mdstat_file, int wait_for_percentage)
    23522351{
    23532352    struct raidlist_itself *raidlist;
    2354     int unfinished_mdstat_devices = 9999, i;
     2353    int unfinished_mdstat_devices = 9999;
     2354    int i = 0;
    23552355    char *screen_message;
    23562356
     
    23622362    while (unfinished_mdstat_devices > 0) {
    23632363            // FIXME: Prefix '/dev/' should really be dynamic!
    2364         if (parse_mdstat(raidlist, "/dev/")) {
     2364        if (parse_mdstat(MDSTAT_FILE, raidlist, "/dev/")) {
    23652365            log_to_screen("Sorry, cannot read %s", MDSTAT_FILE);
    23662366            log_msg(1,"Sorry, cannot read %s", MDSTAT_FILE);
    23672367            return;
    23682368        }
    2369         for (unfinished_mdstat_devices = i = 0; i <= raidlist->entries; i++) {
     2369        for (unfinished_mdstat_devices = 0; i <= raidlist->entries; i++) {
    23702370            if (raidlist->el[i].progress < wait_for_percentage) {
    23712371                unfinished_mdstat_devices++;
     
    23832383                    sleep(2);
    23842384                    // FIXME: Prefix '/dev/' should really be dynamic!
    2385                     if (parse_mdstat(raidlist, "/dev/")) {
     2385                    if (parse_mdstat(MDSTAT_FILE, raidlist, "/dev/")) {
    23862386                        break;
    23872387                    }
Note: See TracChangeset for help on using the changeset viewer.