diff -ur mpt-status-1.1.6/doc/Changelog mpt-status-1.2.0-RC1/doc/Changelog --- mpt-status-1.1.6/doc/Changelog 2006-03-06 19:21:22.000000000 +0100 +++ mpt-status-1.2.0-RC1/doc/Changelog 2006-03-06 20:32:32.000000000 +0100 @@ -1,7 +1,18 @@ 2006-03-06, ratz [ratz@drugphish.ch]: - * Version: 1.1.6 [released] (Codename: Brown Paper Bag I) o mpt-status.c - - commented out SGE pointer debug information + - removed SGE debugging lines + - added checkForLibraryMode() which reads the __MPT_STATUS_LIB + environment variable and if set will initialise the library + functionality of mpt-status. + - changed the output to please Martin Hamant and to also ease + up the scriptability. + +2006-03-05, ratz [ratz@drugphish.ch]: + o doc/Changelog + - fixed overly long line + o mpt-status.c + - added human readable output for IM, IME, IS, which is nothing + else than RAID0, RAID1E and RAID1. 2006-03-04, ratz [ratz@drugphish.ch]: * Version: 1.1.5 [released] (Codename: Sebnem) @@ -38,7 +49,8 @@ o mpt-status.{ch} - s/log_id/vol_id/ in the first line if -s is submitted - added --probe_id which will probe for the first scsi id - - fixed a long standing bug resulting in a coredump when using the -d parameter + - fixed a long standing bug resulting in a coredump when using + the -d parameter - moved print_status_only, id_of_primary_device, ioc_unit into global context, so there is no need to pass those variables through the stack all the time diff -ur mpt-status-1.1.6/doc/ReleaseNotes mpt-status-1.2.0-RC1/doc/ReleaseNotes --- mpt-status-1.1.6/doc/ReleaseNotes 2006-03-06 19:23:32.000000000 +0100 +++ mpt-status-1.2.0-RC1/doc/ReleaseNotes 2006-03-06 20:33:55.000000000 +0100 @@ -1,6 +1,6 @@ -Release Notes mpt-status 1.1.6 (2006-03-06) +Release Notes mpt-status 1.2.0 (2006-mm-dd) ============================== -Codename: Brown Paper Bag I +Codename: About ----- @@ -29,26 +29,15 @@ General Information ------------------- -This release brings you following fixes and new things: -o Removed debugging statements in the normal output -Please skip version 1.1.5! +Problems +-------- Upgrade ------- -No problems are expected when upgrading from the previous (1.1.4) version. Outlook ------- -The next version will bring 64bit support and based on this, sanitized kernel -headers. SuSE and Debian folks have already started this, however only for a -limited range of machine types. Another thing that will be worked on is the -much requested report of the spare disk and a /proc/mdstat like percentage -output to completion of the synchronisation process. - -The next version will probably also break your scripts, because the output -format will slightely be changed to make more sense. This is a heads-up for the -distro maintainters. diff -ur mpt-status-1.1.6/mpt-status.c mpt-status-1.2.0-RC1/mpt-status.c --- mpt-status-1.1.6/mpt-status.c 2006-03-06 19:19:44.000000000 +0100 +++ mpt-status-1.2.0-RC1/mpt-status.c 2006-03-06 20:30:20.000000000 +0100 @@ -84,6 +84,7 @@ static int print_status_only = PRINT_STATUS_ONLY; static int id_of_primary_device = 0; static int ioc_unit = 0; +static int library_mode = 0; static void print_usage(const char *progname) { printf(usage_template, progname); @@ -93,6 +94,17 @@ printf("Version: %s\n", VERSION); } +static void checkForLibraryMode(void) { + char *env; + + /* Library usage detection */ + env = getenv("__MPT_STATUS_LIB"); + if (env != NULL) { + printf("Setting library mode: env = %s\n", env); + library_mode = 1; + } +} + /* // 32bit version static void *read_page(U8 pagetype, U8 pagewhich, U8 pagenumber, @@ -225,7 +237,8 @@ RaidVolumePage0_t *page; RaidPhysDiskPage0_t *phys; //IOCPage5_t *ioc_hotspare; - char *VolumeTypes[] = { "IS", "IME", "IM" }; + static char *VolumeTypes[] = { "IS", "IME", "IM" }; + static char *VolumeTypesHuman[] = { "0", "1E", "1" }; //Raid levels int i; int ioc = 0; @@ -253,16 +266,19 @@ } } if (1 == print_status_only) { - printf("vol_id %d", page->VolumeID); + printf("vol_id:%d", page->VolumeID); } else { - printf("ioc%d vol_id %d type %s, %d phy, %d GB", - page->VolumeIOC, - page->VolumeID, - page->VolumeType < sizeof(VolumeTypes) ? + printf("ioc:%d vol_id:%d type:%s raidlevel:%s num_disks:%d" + " size(GB):%d", + page->VolumeIOC, + page->VolumeID, + page->VolumeType < sizeof(VolumeTypes) ? VolumeTypes[page->VolumeType] : "unknown", - page->NumPhysDisks, - page->MaxLBA / (2 * 1024 * 1024)); - printf(", state"); + page->VolumeType < sizeof(VolumeTypes) ? + VolumeTypesHuman[page->VolumeType] : "", + page->NumPhysDisks, + page->MaxLBA / (2 * 1024 * 1024)); + printf(" state:"); } if (page->VolumeStatus.State == MPI_RAIDVOL0_STATUS_STATE_OPTIMAL) printf(" OPTIMAL"); @@ -271,7 +287,7 @@ if (page->VolumeStatus.State & MPI_RAIDVOL0_STATUS_STATE_FAILED) printf(" FAILED"); if (1 != print_status_only) { - printf(", flags"); + printf(" flags:"); if (page->VolumeStatus.Flags != 0) { if (page->VolumeStatus.Flags & MPI_RAIDVOL0_STATUS_FLAG_ENABLED) @@ -315,16 +331,17 @@ sizeof(phys->InquiryData.ProductRevLevel)); if (1 == print_status_only) { - printf("phys_id %d", phys->PhysDiskNum); + printf("phys_id:%d", phys->PhysDiskNum); } else { - printf("ioc%d phy %d scsi_id %d %s %s %s, %d GB", + printf("ioc:%d phys_id:%d scsi_id:%d vendor:%s " + "product_id:%s revision:%s size(GB):%d", phys->PhysDiskIOC, phys->PhysDiskNum, phys->PhysDiskID, vendor, productid, rev, phys->MaxLBA / (2 * 1024 * 1024)); - printf(", state"); + printf(" state:"); } if (phys->PhysDiskStatus.State == MPI_PHYSDISK0_STATUS_ONLINE) printf(" ONLINE"); @@ -348,7 +365,7 @@ MPI_PHYSDISK0_STATUS_OTHER_OFFLINE) printf(" OTHER_OFFLINE"); if (1 != print_status_only) { - printf(", flags"); + printf(" flags:"); if (phys->PhysDiskStatus.Flags) { if (phys->PhysDiskStatus.Flags & MPI_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC) @@ -466,6 +483,7 @@ } while (next_option != -1); do_init(); + checkForLibraryMode(); print_information(); exit(EXIT_SUCCESS); }