Ignore:
Timestamp:
Apr 11, 2007, 8:59:49 PM (17 years ago)
Author:
Bruno Cornec
Message:
  • evaluate_drive_within_mountlist is a private function
  • support UUID in mondorestore (Improvements for #103)
  • Fix a bug in size computation for cciss and similar devices needing a p before their partition name
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.2/mondo/src/common/libmondo-mountlist.c

    r1236 r1295  
    400400
    401401    /*@ long *********************************************************** */
    402     long physical_drive_size = 0;
    403     long amount_allocated = 0;
     402    long physical_drive_size = 0L;
     403    long amount_allocated = 0L;
    404404
    405405    /*@ pointers ******************************************************* */
     
    433433
    434434    for (curr_part_no = 1; curr_part_no < 99; curr_part_no++) {
    435         sprintf(device, "%s%d", drive, curr_part_no);
     435        if ((strstr(device, "/cciss/") != NULL) ||
     436            (strstr(device, "/ataraid/") != NULL) ||
     437            (strstr(device, "/ida/") != NULL) ||
     438            (strstr(device, "/rd/") != NULL)) {
     439                sprintf(device, "%sp%d", drive, curr_part_no);
     440            } else {   
     441                sprintf(device, "%s%d", drive, curr_part_no);
     442            }
    436443        pos = find_device_in_mountlist(mountlist, device);
    437444        if (pos < 0) {
     
    440447        if (physical_drive_size < 0) {
    441448            sprintf(tmp, " %s refers to non-existent hardware.", device);
     449            log_it(tmp);
    442450            strcat(flaws_str, tmp);
    443451            res++;
     
    969977#if linux
    970978        sscanf(incoming,
    971                "%s %s %s %s %s",
     979               "%s %s %s %s %s %s",
    972980               mountlist->el[items].device,
    973981               mountlist->el[items].mountpoint,
    974982               mountlist->el[items].format,
    975                siz, mountlist->el[items].label);
     983               siz, mountlist->el[items].label, mountlist->el[items].uuid);
    976984#elif __FreeBSD__
    977985        sscanf(incoming,
     
    981989               mountlist->el[items].format, siz);
    982990        strcpy(mountlist->el[items].label, "");
     991        strcpy(mountlist->el[items].uuid, "");
    983992#endif
    984993
     
    10291038
    10301039            sprintf(tmp,
    1031                     "%s %s %s %lld %s",
     1040                    "%s %s %s %lld %s %s",
    10321041                    mountlist->el[items].device,
    10331042                    mountlist->el[items].mountpoint,
    10341043                    mountlist->el[items].format,
    1035                     mountlist->el[items].size, mountlist->el[items].label);
     1044                    mountlist->el[items].size,
     1045                    mountlist->el[items].label,
     1046                    mountlist->el[items].uuid);
    10361047
    10371048            log_it(tmp);
     
    10791090                mountlist->el[i].device, mountlist->el[i].mountpoint,
    10801091                mountlist->el[i].format, mountlist->el[i].size,
    1081                 mountlist->el[i].label);
     1092                mountlist->el[i].label, mountlist->el[i].uuid);
    10821093    }
    10831094    paranoid_fclose(fout);
Note: See TracChangeset for help on using the changeset viewer.