On 08/17/2015 12:23 PM, Gabriel Krisman Bertazi wrote:
> Signed-off-by: Gabriel Krisman Bertazi <kris...@linux.vnet.ibm.com>
> ---
>  iprconfig.c | 27 +++++++++++++++++++++++++++
>  iprconfig.h |  2 ++
>  2 files changed, 29 insertions(+)
> 
> diff --git a/iprconfig.c b/iprconfig.c
> index 7355f83..4039114 100644
> --- a/iprconfig.c
> +++ b/iprconfig.c
> @@ -11525,6 +11525,33 @@ static int update_ucode(struct ipr_dev *dev, struct 
> ipr_fw_images *fw_image)
>       n_download_ucode_in_progress.body = NULL;
>       return rc;
>  }
> +/**
> + * download_all_ucode -
> + * @i_con:           i_container struct
> + *
> + * Returns:
> + *   0 if success / non-zero on failure FIXME
> + **/
> +int download_all_ucode(i_container * i_con)
> +{
> +     struct ipr_ioa *ioa;
> +     struct ipr_dev *dev;
> +     struct ipr_fw_images *lfw;
> +     int rc;
> +
> +     for_each_ioa(ioa) {
> +             if (!ioa->ioa.scsi_dev_data)
> +                     return;
> +             for_each_dev(ioa, dev) {
> +                     lfw = get_latest_fw_image(dev);
> +                     if (!lfw || lfw->version <= get_fw_version(dev))
> +                             continue;
> +                     rc = update_ucode(dev, lfw);
> +                     free(lfw);
> +             }
> +     }
> +     return 0;
> +}
> 
>  /**
>   * process_choose_ucode -
> diff --git a/iprconfig.h b/iprconfig.h
> index 9e91152..5ef800d 100644
> --- a/iprconfig.h
> +++ b/iprconfig.h
> @@ -137,6 +137,7 @@ int change_disk_config(i_container *);
>  int change_ioa_config(i_container *);
>  int ucode_screen(i_container *i_con);
>  int download_ucode(i_container *);
> +int download_all_ucode(i_container *);
>  int choose_ucode(i_container *);
>  int log_menu(i_container *);
>  int ibm_storage_log_tail(i_container *);
> @@ -1560,6 +1561,7 @@ s_node n_confirm_set_default_editor = {
> 
>  struct screen_opts ucode_screen_opt[] = {
>       {download_ucode,      "1", __("Download microcode")},
> +     {download_all_ucode,  "2", __("Download all")},

Let's rename this to "Download latest microcode to all devices". Also, I think 
we need
to add this to the man page as well, right?

One concern I have is that there is no confirmation screen at all in this
flow. I'd really like to see a confirmation screen where we display
the full list of devices we are going to download, the current and new
levels, etc, forcing the user to confirm before going off and updating
a bunch of devices.

Thanks,

Brian


-- 
Brian King
Power Linux I/O
IBM Linux Technology Center



------------------------------------------------------------------------------
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to