[Iprdd-commit] iprutils iprconfig.8, 1.19, 1.20 iprconfig.c, 1.133, 1.134 iprconfig.h, 1.48, 1.49 i
Brought to you by:
brking
|
From: Wayne B. <wb...@us...> - 2008-08-14 01:12:51
|
Update of /cvsroot/iprdd/iprutils In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6250/iprutils Modified Files: iprconfig.8 iprconfig.c iprconfig.h iprlib.c iprlib.h version.mk Log Message: Add support for the array migration functionality. Index: iprlib.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.c,v retrieving revision 1.118 retrieving revision 1.119 diff -u -d -r1.118 -r1.119 --- iprlib.c 14 May 2008 20:17:08 -0000 1.118 +++ iprlib.c 14 Aug 2008 01:12:54 -0000 1.119 @@ -354,6 +354,14 @@ /*---------- subroutine/function code starts here ---------*/ +/** + * ses_table_entry - + * @ioa: ipr ioa struct + * @bus: + * + * Returns: + * ses_table_entry pointer if success / NULL on failure + **/ [...3271 lines suppressed...] + * Returns: + * nothing + **/ void ipr_daemonize() { int rc = fork(); @@ -6350,6 +8102,13 @@ setsid(); } +/** + * ipr_disable_qerr - + * @dev: ipr dev struct + * + * Returns: + * 0 if success / non-zero on failure + **/ int ipr_disable_qerr(struct ipr_dev *dev) { u8 ioctl_buffer[IOCTL_BUFFER_SIZE]; Index: iprconfig.c =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.c,v retrieving revision 1.133 retrieving revision 1.134 diff -u -d -r1.133 -r1.134 --- iprconfig.c 4 Sep 2007 21:05:10 -0000 1.133 +++ iprconfig.c 14 Aug 2008 01:12:52 -0000 1.134 @@ -130,6 +130,16 @@ for (i = 0; i < 2; i++) \ (buf)[i] = print_device(dev, (buf)[i], fmt, type); +static struct sysfs_dev *head_sdev; +static struct sysfs_dev *tail_sdev; + +/** + * is_format_allowed - + * @dev: ipr dev struct + * + * Returns: [...5539 lines suppressed...] + * 0 if success / non-zero on failure + **/ static int non_interactive_cmd(char *cmd, char **args, int num_args) { int rc, i; @@ -11590,6 +14904,14 @@ return -EINVAL; } +/** + * main - program entry point + * @argc: number of arguments + * @argv: argument vector + * + * Returns: + * 0 if success / non-zero on failure + **/ int main(int argc, char *argv[]) { int next_editor, next_dir, next_cmd, next_args, i, rc = 0; Index: iprlib.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprlib.h,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- iprlib.h 9 Apr 2008 19:34:17 -0000 1.100 +++ iprlib.h 14 Aug 2008 01:12:54 -0000 1.101 @@ -51,19 +51,19 @@ #include <linux/netlink.h> #include <time.h> -#define IPR_DASD_UCODE_USRLIB 0 -#define IPR_DASD_UCODE_ETC 1 +#define IPR_DASD_UCODE_USRLIB 0 +#define IPR_DASD_UCODE_ETC 1 -#define IPR_DASD_UCODE_NOT_FOUND -1 -#define IPR_DASD_UCODE_NO_HDR 1 -#define IPR_DASD_UCODE_HDR 2 +#define IPR_DASD_UCODE_NOT_FOUND -1 +#define IPR_DASD_UCODE_NO_HDR 1 +#define IPR_DASD_UCODE_HDR 2 -#define UCODE_BASE_DIR "/usr/lib/microcode" -#define LINUX_UCODE_BASE_DIR "/lib/firmware" +#define UCODE_BASE_DIR "/usr/lib/microcode" +#define LINUX_UCODE_BASE_DIR "/lib/firmware" -#define FIRMWARE_HOTPLUG_DIR_TAG "FIRMWARE_DIR" -#define FIRMWARE_HOTPLUG_CONFIG_FILE "/etc/hotplug/firmware.agent" -#define FIRMWARE_HOTPLUG_DEFAULT_DIR LINUX_UCODE_BASE_DIR +#define FIRMWARE_HOTPLUG_DIR_TAG "FIRMWARE_DIR" +#define FIRMWARE_HOTPLUG_CONFIG_FILE "/etc/hotplug/firmware.agent" +#define FIRMWARE_HOTPLUG_DEFAULT_DIR LINUX_UCODE_BASE_DIR #define IPR_JBOD_BLOCK_SIZE 512 #define IPR_DEFAULT_AF_BLOCK_SIZE 522 @@ -81,36 +81,36 @@ #define IPR_INVALID_ARRAY_ID 0xFF #define IPR_IOA_RESOURCE_HANDLE 0xffffffff #define IPR_RECLAIM_NUM_BLOCKS_MULTIPLIER 256 -#define IPR_SDB_CHECK_AND_QUIESCE 0x00 -#define IPR_SDB_CHECK_ONLY 0x40 -#define IPR_SDB_CHECK_AND_QUIESCE_ENC 0x0e -#define IPR_RDB_UNQUIESCE_AND_REBALANCE 0x20 +#define IPR_SDB_CHECK_AND_QUIESCE 0x00 +#define IPR_SDB_CHECK_ONLY 0x40 +#define IPR_SDB_CHECK_AND_QUIESCE_ENC 0x0e +#define IPR_RDB_UNQUIESCE_AND_REBALANCE 0x20 #define IPR_MAX_NUM_SUPP_INQ_PAGES 36 #define IPR_DUMP_TRACE_ENTRY_SIZE 8192 #define IPR_MODE_SENSE_LENGTH 255 #define IPR_DEFECT_LIST_HDR_LEN 4 #define IPR_FORMAT_DATA 0x10 #define IPR_FORMAT_IMMED 2 -#define IPR_ARRAY_CMD_TIMEOUT (2 * 60) /* 2 minutes */ -#define IPR_INTERNAL_DEV_TIMEOUT (2 * 60) /* 2 minutes */ +#define IPR_ARRAY_CMD_TIMEOUT (2 * 60) /* 2 minutes */ +#define IPR_INTERNAL_DEV_TIMEOUT (2 * 60) /* 2 minutes */ #define IPR_FORMAT_UNIT_TIMEOUT (3 * 60 * 60) /* 3 hours */ -#define IPR_INTERNAL_TIMEOUT (30) /* 30 seconds */ -#define IPR_SUSPEND_DEV_BUS_TIMEOUT (35) /* 35 seconds */ -#define IPR_EVALUATE_DEVICE_TIMEOUT (2 * 60) /* 2 minutes */ -#define IPR_WRITE_BUFFER_TIMEOUT (8 * 60) /* 8 minutes */ -#define SET_DASD_TIMEOUTS_TIMEOUT (2 * 60) +#define IPR_INTERNAL_TIMEOUT (30) /* 30 seconds */ +#define IPR_SUSPEND_DEV_BUS_TIMEOUT (35) /* 35 seconds */ +#define IPR_EVALUATE_DEVICE_TIMEOUT (2 * 60) /* 2 minutes */ +#define IPR_WRITE_BUFFER_TIMEOUT (8 * 60) /* 8 minutes */ +#define SET_DASD_TIMEOUTS_TIMEOUT (2 * 60) #define IPR_NUM_DRIVE_ELEM_STATUS_ENTRIES 50 #define IPR_DRIVE_ELEM_STATUS_EMPTY 5 #define IPR_DRIVE_ELEM_STATUS_POPULATED 1 #define IPR_DRIVE_ELEM_STATUS_UNSUPP 0 -#define IPR_TIMEOUT_SECOND_RADIX 0x0000 -#define IPR_TIMEOUT_MINUTE_RADIX 0x4000 -#define IPR_TIMEOUT_RADIX_MASK 0xC000 +#define IPR_TIMEOUT_SECOND_RADIX 0x0000 +#define IPR_TIMEOUT_MINUTE_RADIX 0x4000 +#define IPR_TIMEOUT_RADIX_MASK 0xC000 #define IPR_TIMEOUT_RADIX_IS_MINUTE(to) \ (((to) & IPR_TIMEOUT_RADIX_MASK) == IPR_TIMEOUT_MINUTE_RADIX) #define IPR_TIMEOUT_RADIX_IS_SECONDS(to) \ (((to) & IPR_TIMEOUT_RADIX_MASK) == IPR_TIMEOUT_SECOND_RADIX) -#define IPR_TIMEOUT_MASK 0x3FFF +#define IPR_TIMEOUT_MASK 0x3FFF #define IPR_IOA_DEBUG 0xDDu #define IPR_IOA_DEBUG_READ_IOA_MEM 0x00u @@ -119,40 +119,41 @@ #define IPR_IOA_DEBUG_ENABLE_DBG_FUNC 0x0Au #define IPR_IOA_DEBUG_DISABLE_DBG_FUNC 0x0Bu -#define IPR_STD_INQ_Z0_TERM_LEN 8 -#define IPR_STD_INQ_Z1_TERM_LEN 12 -#define IPR_STD_INQ_Z2_TERM_LEN 4 -#define IPR_STD_INQ_Z3_TERM_LEN 5 -#define IPR_STD_INQ_Z4_TERM_LEN 4 -#define IPR_STD_INQ_Z5_TERM_LEN 2 -#define IPR_STD_INQ_Z6_TERM_LEN 10 -#define IPR_STD_INQ_PART_NUM_LEN 12 -#define IPR_STD_INQ_EC_LEVEL_LEN 10 -#define IPR_STD_INQ_FRU_NUM_LEN 12 +#define IPR_STD_INQ_Z0_TERM_LEN 8 +#define IPR_STD_INQ_Z1_TERM_LEN 12 +#define IPR_STD_INQ_Z2_TERM_LEN 4 +#define IPR_STD_INQ_Z3_TERM_LEN 5 +#define IPR_STD_INQ_Z4_TERM_LEN 4 +#define IPR_STD_INQ_Z5_TERM_LEN 2 +#define IPR_STD_INQ_Z6_TERM_LEN 10 +#define IPR_STD_INQ_PART_NUM_LEN 12 +#define IPR_STD_INQ_EC_LEVEL_LEN 10 +#define IPR_STD_INQ_FRU_NUM_LEN 12 -#define IPR_START_STOP_STOP 0x00 -#define IPR_START_STOP_START 0x01 -#define IPR_READ_CAPACITY_16 0x10 +#define IPR_START_STOP_STOP 0x00 +#define IPR_START_STOP_START 0x01 +#define IPR_READ_CAPACITY_16 0x10 #define IPR_SERVICE_ACTION_IN 0x9E #define IPR_MAINTENANCE_IN 0xA3 -#define IPR_QUERY_MULTI_ADAPTER_STATUS 0x01 +#define IPR_QUERY_MULTI_ADAPTER_STATUS 0x01 #define IPR_MAINTENANCE_OUT 0xA4 -#define IPR_CHANGE_MULTI_ADAPTER_ASSIGNMENT 0x02 +#define IPR_CHANGE_MULTI_ADAPTER_ASSIGNMENT 0x02 #define IPR_QUERY_RESOURCE_STATE 0xC2 #define IPR_QUERY_COMMAND_STATUS 0xCB #define IPR_SUSPEND_DEV_BUS 0xC8 #define IPR_RESUME_DEV_BUS 0xC9 #define IPR_IOA_SERVICE_ACTION 0xD2 -#define IPR_QUERY_RES_ADDR_ALIASES 0x10 -#define IPR_DISRUPT_DEVICE 0x11 -#define IPR_QUERY_SAS_EXPANDER_INFO 0x12 -#define IPR_QUERY_RES_REDUNDANCY_INFO 0x13 +#define IPR_QUERY_RES_ADDR_ALIASES 0x10 +#define IPR_DISRUPT_DEVICE 0x11 +#define IPR_QUERY_SAS_EXPANDER_INFO 0x12 +#define IPR_QUERY_RES_REDUNDANCY_INFO 0x13 #define IPR_EVALUATE_DEVICE 0xE4 -#define SKIP_READ 0xE8 -#define SKIP_WRITE 0xEA -#define QUERY_DASD_TIMEOUTS 0xEB -#define SET_DASD_TIMEOUTS 0xEC -#define IPR_QUERY_ARRAY_CONFIG 0xF0 +#define SKIP_READ 0xE8 +#define SKIP_WRITE 0xEA +#define QUERY_DASD_TIMEOUTS 0xEB +#define SET_DASD_TIMEOUTS 0xEC +#define IPR_MIGRATE_ARRAY_PROTECTION 0xEF +#define IPR_QUERY_ARRAY_CONFIG 0xF0 #define IPR_START_ARRAY_PROTECTION 0xF1 #define IPR_STOP_ARRAY_PROTECTION 0xF2 #define IPR_RESYNC_ARRAY_PROTECTION 0xF3 @@ -160,24 +161,24 @@ #define IPR_REMOVE_ARRAY_DEVICE 0xF5 #define IPR_REBUILD_DEVICE_DATA 0xF6 #define IPR_RECLAIM_CACHE_STORE 0xF8 -#define IPR_RECLAIM_ACTION 0x68 -#define IPR_RECLAIM_PERFORM 0x00 -#define IPR_RECLAIM_RESET_BATTERY_ERROR 0x08 -#define IPR_RECLAIM_EXTENDED_INFO 0x10 -#define IPR_RECLAIM_QUERY 0x20 -#define IPR_RECLAIM_RESET 0x40 -#define IPR_RECLAIM_FORCE_BATTERY_ERROR 0x60 -#define IPR_RECLAIM_UNKNOWN_PERM 0x80 -#define SET_SUPPORTED_DEVICES 0xFB +#define IPR_RECLAIM_ACTION 0x68 +#define IPR_RECLAIM_PERFORM 0x00 +#define IPR_RECLAIM_RESET_BATTERY_ERROR 0x08 +#define IPR_RECLAIM_EXTENDED_INFO 0x10 +#define IPR_RECLAIM_QUERY 0x20 +#define IPR_RECLAIM_RESET 0x40 +#define IPR_RECLAIM_FORCE_BATTERY_ERROR 0x60 +#define IPR_RECLAIM_UNKNOWN_PERM 0x80 +#define SET_SUPPORTED_DEVICES 0xFB #define IPR_STD_INQUIRY 0xFF #ifndef REPORT_LUNS -#define REPORT_LUNS 0xA0 +#define REPORT_LUNS 0xA0 #endif #define IPR_XLATE_DEV_FMT_RC(rc) ((((rc) & 127) == 51) ? -EIO : 0) -#define IPR_TYPE_AF_DISK 0xC -#define IPR_TYPE_ADAPTER 0x1f -#define IPR_TYPE_EMPTY_SLOT 0xff +#define IPR_TYPE_AF_DISK 0xC +#define IPR_TYPE_ADAPTER 0x1f +#define IPR_TYPE_EMPTY_SLOT 0xff #define IPR_IS_DASD_DEVICE(std_inq_data) \ ((((std_inq_data).peri_dev_type) == TYPE_DISK) && !((std_inq_data).removeable_medium)) @@ -638,9 +639,15 @@ #define IPR_DEFAULT_RAID_LVL "5" #if defined (__BIG_ENDIAN_BITFIELD) u8 include_allowed:1; - u8 reserved:7; + u8 reserved:5; + u8 format_overlay_type:2; + +#define IPR_FORMAT_ADD_DEVICES 1 +#define IPR_FORMAT_REMOVE_DEVICES 2 + #elif defined (__LITTLE_ENDIAN_BITFIELD) - u8 reserved:7; + u8 format_overlay_type:2; + u8 reserved:5; u8 include_allowed:1; #endif u16 reserved2; @@ -686,7 +693,8 @@ u8 start_cand:1; u8 stop_cand:1; u8 resync_cand:1; - u8 reserved4:5; + u8 migrate_cand:1; + u8 reserved4:4; #elif defined (__LITTLE_ENDIAN_BITFIELD) u8 reserved3:3; u8 no_config_entry:1; @@ -695,7 +703,8 @@ u8 exposed:1; u8 established:1; - u8 reserved4:5; + u8 reserved4:4; + u8 migrate_cand:1; u8 resync_cand:1; u8 stop_cand:1; u8 start_cand:1; @@ -746,7 +755,8 @@ u8 add_hot_spare_cand:1; u8 rmv_hot_spare_cand:1; - u8 reserved3:6; + u8 migrate_array_prot_cand:1; + u8 reserved3:5; #elif defined (__LITTLE_ENDIAN_BITFIELD) u8 reserved2:2; u8 no_cfgte_dev:1; @@ -765,7 +775,8 @@ u8 parity_cand:1; u8 start_cand:1; - u8 reserved3:6; + u8 reserved3:5; + u8 migrate_array_prot_cand:1; u8 rmv_hot_spare_cand:1; u8 add_hot_spare_cand:1; #endif @@ -788,6 +799,10 @@ ((unsigned long)rcd) < ((unsigned long)((qac)->data + sizeof((qac)->data))); \ rcd = (type *)((unsigned long)rcd + ntohs(((struct ipr_common_record *)rcd)->record_len))) +#define for_each_supported_arrays_rcd(rcd, qac) \ + __for_each_qac_entry(rcd, qac, struct ipr_supported_arrays) \ + if (rcd->common.record_id == IPR_RECORD_ID_SUPPORTED_ARRAYS) + #define for_each_qac_entry(rcd, qac) \ __for_each_qac_entry(rcd, qac, struct ipr_common_record) @@ -1783,7 +1798,7 @@ #define IPR_PATH_NOT_ACTIVE 0x80 #define IPR_PATH_STATE_MASK 0x0F -#define IPR_PATH_STATE_NO_INFO 0x00 +#define IPR_PATH_STATE_NO_INFO 0x00 #define IPR_PATH_HEALTHY 0x01 #define IPR_PATH_DEGRADED 0x02 #define IPR_PATH_FAILED 0x03 @@ -1979,11 +1994,12 @@ int set_preferred_primary(struct ipr_ioa *, int); void check_current_config(bool); int num_device_opens(int, int, int, int); +int open_and_lock(char *); void tool_init(int); void exit_on_error(char *, ...); bool is_af_blocked(struct ipr_dev *, int); -int ipr_query_array_config(struct ipr_ioa *, bool, bool, int, void *); -int __ipr_query_array_config(struct ipr_ioa *, int, bool, bool, int, void *); +int ipr_query_array_config(struct ipr_ioa *, bool, bool, bool, int, void *); +int __ipr_query_array_config(struct ipr_ioa *, int, bool, bool, bool, int, void *); int ipr_query_command_status(struct ipr_dev *, void *); int ipr_mode_sense(struct ipr_dev *, u8, void *); int ipr_mode_select(struct ipr_dev *, void *, int); @@ -1999,6 +2015,8 @@ int ipr_stop_array_protection(struct ipr_ioa *); int ipr_remove_hot_spare(struct ipr_ioa *); int ipr_start_array_protection(struct ipr_ioa *, int, int); +int ipr_migrate_array_protection(struct ipr_ioa *, + struct ipr_array_query_data *, int, int, int); int ipr_add_hot_spare(struct ipr_ioa *); int ipr_rebuild_device_data(struct ipr_ioa *); int ipr_resync_array(struct ipr_ioa *); Index: iprconfig.h =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.h,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- iprconfig.h 25 Apr 2007 16:07:15 -0000 1.48 +++ iprconfig.h 14 Aug 2008 01:12:54 -0000 1.49 @@ -12,30 +12,31 @@ **/ #include <libintl.h> + #define _(string) gettext(string) #define __(string) (string) -#define EXIT_FLAG 0x8000 /* stops at given screen on exit call */ -#define CANCEL_FLAG 0x4000 /* stops at given screen on quit call */ -#define REFRESH_FLAG 0x2000 /* refreshes screen on quit or exit */ -#define TOGGLE_FLAG 0x1000 -#define FWD_FLAG 0x0800 -#define CONFIRM_FLAG 0x0400 -#define CONFIRM_REC_FLAG 0x0200 -#define MENU_FLAG 0x0100 -#define ENTER_FLAG 0x0080 +#define EXIT_FLAG 0x8000 /* stops at given screen on exit call */ +#define CANCEL_FLAG 0x4000 /* stops at given screen on quit call */ +#define REFRESH_FLAG 0x2000 /* refreshes screen on quit or exit */ +#define TOGGLE_FLAG 0x1000 +#define FWD_FLAG 0x0800 +#define CONFIRM_FLAG 0x0400 +#define CONFIRM_REC_FLAG 0x0200 +#define MENU_FLAG 0x0100 +#define ENTER_FLAG 0x0080 #define NUM_OPTS(x) (sizeof(x)/sizeof(struct screen_opts)) -#define REFRESH_SCREEN -13 -#define TOGGLE_SCREEN -14 +#define REFRESH_SCREEN -13 +#define TOGGLE_SCREEN -14 -#define INVALID_OPTION_STATUS 2 -#define PGUP_STATUS 3 -#define TOP_STATUS 4 -#define PGDN_STATUS 5 -#define BTM_STATUS 6 +#define INVALID_OPTION_STATUS 2 +#define PGUP_STATUS 3 +#define TOP_STATUS 4 +#define PGDN_STATUS 5 +#define BTM_STATUS 6 -#define MAX_FIELD_SIZE 39 +#define MAX_FIELD_SIZE 39 typedef struct info_container i_container; @@ -43,8 +44,8 @@ i_container *next_item; /* reference to next info_container */ char field_data[MAX_FIELD_SIZE + 1]; /* stores characters entered into a user-entry field */ void *data; /* stores a field pointer */ - int y; /* cursor y position of user selection */ - int x; /* cursor x position of user selection */ + int y; /* cursor y position of user selection */ + int x; /* cursor x position of user selection */ }; #define for_each_icon(icon) for (icon = i_con_head; icon; icon = icon->next_item) @@ -107,6 +108,8 @@ int confirm_hot_spare(int action); int hot_spare_complete(int action); +int raid_migrate(i_container * i_con); + int raid_rebuild(i_container * i_con); int confirm_raid_rebuild(i_container * i_con); int raid_resync(i_container * i_con); @@ -144,6 +147,8 @@ int ibm_boot_log(i_container *); int exit_confirmed(i_container *); +static int raid_create_check_num_devs(struct ipr_array_cap_entry *, int, int); + /* constant strings */ const char *no_dev_found = __("No devices found"); const char *wait_for_next_screen = __("Please wait for the next screen."); @@ -260,6 +265,68 @@ {add_hot_spare, "7", __("Create a hot spare")}, {remove_hot_spare, "8", __("Delete a hot spare")}, {raid_resync, "9", __("Force RAID Consistency Check")}, + {raid_migrate, "0", __("Migrate disk array protection")}, +}; + +s_node n_raid_migrate_complete = { + .title = __("Migrate Disk Array Status"), + .body = __("You selected to migrate a disk array") +}; + +s_node n_confirm_raid_migrate = { + .rc_flags = (CANCEL_FLAG), + .f_flags = (CANCEL_FLAG | TOGGLE_FLAG | FWD_FLAG), + .num_opts = NUM_OPTS(null_opt), + .options = &null_opt[0], + .title = __("Confirm Migrate a Disk Array"), + .header = { + __("ATTENTION: Disk array will be migrated.\n\n"), + __("Press Enter to continue.\n"), + __(" q=Cancel to return and change your choice.\n\n"), + "" } +}; + +s_node n_raid_migrate = { + .rc_flags = (EXIT_FLAG | CANCEL_FLAG | REFRESH_FLAG), + .f_flags = (EXIT_FLAG | CANCEL_FLAG | TOGGLE_FLAG | FWD_FLAG ), + .num_opts = NUM_OPTS(null_opt), + .options = &null_opt[0], + .title = __("Migrate Disk Array Protection"), + .header = { + __("Select only one disk array for migration.\n\n"), + __("Type choice, press Enter.\n"), + __(" 1=migrate protection for a disk array\n\n"), + "" } +}; + +s_node n_raid_migrate_fail = { + .f_flags = (ENTER_FLAG | EXIT_FLAG | CANCEL_FLAG), + .title = __("Disk Array Migration Failed"), + .header = { + __("There are no arrays eligible for the selected operation " + "due to one or more of the following reasons:\n\n"), + __("o There are no disk arrays in the system.\n"), + __("o An IOA is in a condition that makes the disks attached to " + "it read/write protected. Examine the kernel messages log " + "for any errors that are logged for the IO subsystem " + "and follow the appropriate procedure for the reference " + "code to correct the problem, if necessary.\n"), + __("o Not all disks attached to an advanced function IOA have" + "reported to the system. Retry the operation.\n"), + __("o There are not enough unused AF disks for the migration.\n"), + "" } +}; + +s_node n_raid_migrate_add_disks = { + .rc_flags = (CANCEL_FLAG | REFRESH_FLAG), + .f_flags = (EXIT_FLAG | CANCEL_FLAG | TOGGLE_FLAG | FWD_FLAG), + .num_opts = NUM_OPTS(null_opt), + .options = &null_opt[0], + .title = __("Select Disk Units for Migration"), + .header = { + __("Type option, press Enter.\n"), + __(" 1=Select\n\n"), + "" } }; s_node n_raid_screen = { @@ -424,8 +491,8 @@ __("o An IOA is in a condition that makes the disks attached to " "it read/write protected. Examine the kernel messages log " "for any errors that are logged for the IO subsystem " - "and follow the appropriate procedure for the reference code to " - "correct the problem, if necessary.\n"), + "and follow the appropriate procedure for the reference " + "code to correct the problem, if necessary.\n"), __("o Not all disks attached to an advanced function IOA have" "reported to the system. Retry the operation.\n"), __("o The disks are missing.\n"), @@ -1424,8 +1491,8 @@ /* 63 */ __("Editor unchanged"), /* 64 */ __("Default log values restored"), /* 65 */ __("Editor returned %d. Try setting the default editor."), - /* 66 */ __("Failed to change disk configuration."), - /* 67 */ __("Microcode Download failed."), + /* 66 */ __("Failed to change disk configuration."), + /* 67 */ __("Microcode Download failed."), /* 68 */ __("Failed to enable IOA cache."), /* 69 */ __("Invalid number of devices selected."), /* 70 */ __("Failed to start IOA cache."), @@ -1435,7 +1502,98 @@ /* 74 */ __("RAID Consistency check successful"), /* 75 */ __("Failed to read error log. Try setting root kernel message log directory."), /* 76 */ __("No SAS disks available"), + /* 77 */ __("Too many disks were selected. The maximum is %d."), + /* 78 */ __("Too few disks were selected. The minimum is %d."), + /* 79 */ __("Migrate Array Protection completed successfully."), + /* 80 */ __("Migrate Array Protection failed."), + /* NOTE: 127 maximum limit */ }; -#endif +/* TODO - replace constants in iprconfig.c with the following enums/defines */ +enum { + RC_0_Success = 0, + RC_1_Blank, + RC_2_Invalid_Option, + RC_3_Screen_Up, + RC_4_At_Top, + RC_5_Screen_Down, + RC_6_At_Bottom, + RC_7_Blank, + RC_8_Blank, + RC_9_Blank, + RC_10_No_Devices, + RC_11_Blank, + RC_12_Blank, + RC_13_Blank, + RC_14_Blank, + RC_15_Invalid_Selection, + RC_16_More_Than_One_Dev, + RC_17_Invalid_Option, + RC_18_Array_Created, + RC_19_Create_Fail, + RC_20_Delete_Fail, + RC_21_Delete_Success, + RC_22_Blank, + RC_23_Blank, + RC_24_Blank, + RC_25_Devices_Multiple, + RC_26_Add_Fail, + RC_27_Add_Success, + RC_28_Rebuild_Started, + RC_29_Rebuild_Fail, + RC_30_Maint_Fail, + RC_31_Maint_Fail_In_Use, + RC_32_Maint_Success, + RC_33_No_Units, + RC_34_Init_Format_Success, + RC_35_Init_Format_Fail, + RC_36_Reclaim_Cache_Success, + RC_37_Reclaim_Cache_Fail, + RC_38_No_Reclaim_Needed, + RC_39_No_Reclaim_Performed, + RC_40_Rebuild_Started, + RC_41_Rebuild_Failed, + RC_42_Battery_Err_State_Success, + RC_43_Battery_Err_State_Fail, + RC_44_No_Battery_Pack, + RC_45_Change_Bus_Conf_Success, + RC_46_Change_Bus_Conf_Fail, + RC_47_Change_Driver_Conf_Success, + RC_48_Change_Driver_Conf_Fail, + RC_49_No_Units_Available, + RC_50_Init_Format_Success, + RC_51_Init_Format_Fail, + RC_52_No_Devices_Available, + RC_53_Hot_Spare_Created, + RC_54_Hot_Spare_Deleted, + RC_55_Failed_Create, + RC_56_Failed_Delete, + RC_57_Change_Driver_Conf_Success, + RC_58_Change_Driver_Conf_Fail, + RC_59_Invalid_Dir, + RC_60_Root_Changed, + RC_61_Root_Unchanged, + RC_62_Editor_Changed, + RC_63_Editor_Unchanged, + RC_64_Log_Restored, + RC_65_Set_Default_Editor, + RC_66_Disk_Conf_Fail, + RC_67_uCode_Download_Fail, + RC_68_Cache_Enable_Fail, + RC_69_Invalid_Number_Devs, + RC_70_Cache_Start_Fail, + RC_71_Cache_Start_Success, + RC_72_Battery_Err_State, + RC_73_Force_Check_Fail, + RC_74_Check_Success, + RC_75_Failed_Read_Err_Log, + RC_76_No_SAS_Disks, + RC_77_Too_Many_Disks, + RC_78_Too_Few_Disks, + RC_79_Migrate_Prot_Success, + RC_80_Migrate_Prot_Fail, + /* NOTE: 127 maximum limit */ +}; + +#endif /* iprconfig_h */ Index: version.mk =================================================================== RCS file: /cvsroot/iprdd/iprutils/version.mk,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- version.mk 9 Apr 2008 20:07:50 -0000 1.68 +++ version.mk 14 Aug 2008 01:12:54 -0000 1.69 @@ -6,9 +6,9 @@ IPR_MAJOR_RELEASE=2 IPR_MINOR_RELEASE=2 -IPR_FIX_LEVEL=9 +IPR_FIX_LEVEL=10 IPR_RELEASE=1 -IPR_FIX_DATE=(April 9, 2008) +IPR_FIX_DATE=(August 13, 2008) IPR_VERSION_STR=$(IPR_MAJOR_RELEASE).$(IPR_MINOR_RELEASE).$(IPR_FIX_LEVEL) $(IPR_FIX_DATE) Index: iprconfig.8 =================================================================== RCS file: /cvsroot/iprdd/iprutils/iprconfig.8,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- iprconfig.8 4 Sep 2007 21:05:10 -0000 1.19 +++ iprconfig.8 14 Aug 2008 01:12:52 -0000 1.20 @@ -366,6 +366,31 @@ .br Show the current dual path details for the specified SAS device. .TP +.B query-arrays-raid-migrate +.br +Show the arrays that can be migrated to a different protection level. +.TP +.B query-devices-raid-migrate [array] +.br +Show the AF disks that are candidates to be used in a migration for a given +array. +.TP +.B query-raid-levels-raid-migrate [array] +.br +Show the protection levels to which the given array can be migrated. +.TP +.B query-stripe-sizes-raid-migrate [array] [raid level] +.br +Given an array and a protection level, show the valid stripe sizes to which +the array can be migrated. +.TP +.B query-devices-min-max-raid-migrate [array] [raid level] +.br +Show the number of devices that will be removed for a migration to a protection +level that requires fewer devices. Or, show the minmum number of devices +required, the maximum number of devices allowed and the multiple of the number +of devices required for a migration that requires more devices. +.TP .B raid-create [-r raid_level] [-s stripe_size_in_kb] [devices...] Create a RAID array. RAID level can be any supported RAID level for the given adapter, such as 0, 10, 5, 6. Currently supported stripe sizes in kb @@ -395,6 +420,15 @@ .br .B iprconfig -c raid-include sda sg6 sg7 .TP +.B raid-migrate -r raid_level [-s stripe_size_in_kb] array [disk] ... [disk] +.br +Migrate an existing RAID array to a new RAID protection level. Optionally, +a new stripe size can be given. In some cases one or more new disks must be +added for the migration to succeed. +Example: +.br +.B iprconfig -c raid-migrate -r 10 -s 64 sda sg5 sg6 +.TP .B format-for-raid [disk] ... [disk] .br Format the specified disks for Advanced Function so they can be used in |