[dm-devel] [PATCH 3/5] libmultipath: add ALUA tpg path wildcard

Martin Wilck martin.wilck at suse.com
Wed May 31 15:21:26 UTC 2023


On Fri, 2023-05-19 at 18:02 -0500, Benjamin Marzinski wrote:
> Make it possible to easily check a path's target port group.
> 
> Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>

Reviewed-by: Martin Wilck <mwilck at suse.com>

> ---
>  libmultipath/print.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/libmultipath/print.c b/libmultipath/print.c
> index 3193dbe0..360308d2 100644
> --- a/libmultipath/print.c
> +++ b/libmultipath/print.c
> @@ -782,6 +782,14 @@ snprint_path_vpd_data(struct strbuf *buff, const
> struct path * pp)
>         return append_strbuf_str(buff, "[undef]");
>  }
>  
> +static int
> +snprint_alua_tpg(struct strbuf *buff, const struct path * pp)
> +{
> +       if (pp->tpg_id < 0)
> +               return append_strbuf_str(buff, "[undef]");
> +       return print_strbuf(buff, "0x%04x", pp->tpg_id);
> +}
> +
>  static const struct multipath_data mpd[] = {
>         {'n', "name",          snprint_name},
>         {'w', "uuid",          snprint_multipath_uuid},
> @@ -836,6 +844,7 @@ static const struct path_data pd[] = {
>         {'P', "protocol",      snprint_path_protocol},
>         {'I', "init_st",       snprint_initialized},
>         {'L', "LUN hex",       snprint_path_lunhex},
> +       {'A', "TPG",           snprint_alua_tpg},
>  };
>  
>  static const struct pathgroup_data pgd[] = {



More information about the dm-devel mailing list