dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: mwilck@suse.com
Cc: dm-devel@redhat.com
Subject: Re: [dm-devel] [PATCH 7/9] libmultipath: print.h: move macros to print.c
Date: Wed, 28 Jul 2021 21:36:55 -0500	[thread overview]
Message-ID: <20210729023655.GO3087@octiron.msp.redhat.com> (raw)
In-Reply-To: <20210715105223.30463-8-mwilck@suse.com>

On Thu, Jul 15, 2021 at 12:52:21PM +0200, mwilck@suse.com wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> Move all macros to print.c that aren't used in other source files.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
>  libmultipath/print.c | 66 +++++++++++++++++++++++++++++++++++++++++
>  libmultipath/print.h | 70 +-------------------------------------------
>  2 files changed, 67 insertions(+), 69 deletions(-)
> 
> diff --git a/libmultipath/print.c b/libmultipath/print.c
> index 5b86483..6a5c465 100644
> --- a/libmultipath/print.c
> +++ b/libmultipath/print.c
> @@ -34,6 +34,72 @@
>  #include "foreign.h"
>  #include "strbuf.h"
>  
> +#define PRINT_PATH_LONG      "%w %i %d %D %p %t %T %s %o"
> +#define PRINT_PATH_INDENT    "%i %d %D %t %T %o"
> +#define PRINT_MAP_PROPS      "size=%S features='%f' hwhandler='%h' wp=%r"
> +#define PRINT_PG_INDENT      "policy='%s' prio=%p status=%t"
> +
> +#define PRINT_JSON_MULTIPLIER     5
> +#define PRINT_JSON_MAJOR_VERSION  0
> +#define PRINT_JSON_MINOR_VERSION  1
> +#define PRINT_JSON_START_VERSION  "   \"major_version\": %d,\n" \
> +				  "   \"minor_version\": %d,\n"
> +#define PRINT_JSON_START_ELEM     "{\n"
> +#define PRINT_JSON_START_MAP      "   \"map\":"
> +#define PRINT_JSON_START_MAPS     "\"maps\": ["
> +#define PRINT_JSON_START_PATHS    "\"paths\": ["
> +#define PRINT_JSON_START_GROUPS   "\"path_groups\": ["
> +#define PRINT_JSON_END_ELEM       "},"
> +#define PRINT_JSON_END_LAST_ELEM  "}"
> +#define PRINT_JSON_END_LAST       "}\n"
> +#define PRINT_JSON_END_ARRAY      "]\n"
> +#define PRINT_JSON_INDENT_N    3
> +#define PRINT_JSON_MAP       "{\n" \
> +			     "      \"name\" : \"%n\",\n" \
> +			     "      \"uuid\" : \"%w\",\n" \
> +			     "      \"sysfs\" : \"%d\",\n" \
> +			     "      \"failback\" : \"%F\",\n" \
> +			     "      \"queueing\" : \"%Q\",\n" \
> +			     "      \"paths\" : %N,\n" \
> +			     "      \"write_prot\" : \"%r\",\n" \
> +			     "      \"dm_st\" : \"%t\",\n" \
> +			     "      \"features\" : \"%f\",\n" \
> +			     "      \"hwhandler\" : \"%h\",\n" \
> +			     "      \"action\" : \"%A\",\n" \
> +			     "      \"path_faults\" : %0,\n" \
> +			     "      \"vend\" : \"%v\",\n" \
> +			     "      \"prod\" : \"%p\",\n" \
> +			     "      \"rev\" : \"%e\",\n" \
> +			     "      \"switch_grp\" : %1,\n" \
> +			     "      \"map_loads\" : %2,\n" \
> +			     "      \"total_q_time\" : %3,\n" \
> +			     "      \"q_timeouts\" : %4,"
> +
> +#define PRINT_JSON_GROUP     "{\n" \
> +			     "         \"selector\" : \"%s\",\n" \
> +			     "         \"pri\" : %p,\n" \
> +			     "         \"dm_st\" : \"%t\",\n" \
> +			     "         \"marginal_st\" : \"%M\","
> +
> +#define PRINT_JSON_GROUP_NUM "         \"group\" : %d,\n"
> +
> +#define PRINT_JSON_PATH      "{\n" \
> +			     "            \"dev\" : \"%d\",\n"\
> +			     "            \"dev_t\" : \"%D\",\n" \
> +			     "            \"dm_st\" : \"%t\",\n" \
> +			     "            \"dev_st\" : \"%o\",\n" \
> +			     "            \"chk_st\" : \"%T\",\n" \
> +			     "            \"checker\" : \"%c\",\n" \
> +			     "            \"pri\" : %p,\n" \
> +			     "            \"host_wwnn\" : \"%N\",\n" \
> +			     "            \"target_wwnn\" : \"%n\",\n" \
> +			     "            \"host_wwpn\" : \"%R\",\n" \
> +			     "            \"target_wwpn\" : \"%r\",\n" \
> +			     "            \"host_adapter\" : \"%a\",\n" \
> +			     "            \"marginal_st\" : \"%M\""
> +
> +#define PROGRESS_LEN  10
> +
>  #define MAX(x,y) (((x) > (y)) ? (x) : (y))
>  #define MIN(x,y) (((x) > (y)) ? (y) : (x))
>  /*
> diff --git a/libmultipath/print.h b/libmultipath/print.h
> index b922812..c6674a5 100644
> --- a/libmultipath/print.h
> +++ b/libmultipath/print.h
> @@ -2,80 +2,12 @@
>  #define _PRINT_H
>  #include "dm-generic.h"
>  
> -struct strbuf;
> -
> -#define PRINT_PATH_LONG      "%w %i %d %D %p %t %T %s %o"
> -#define PRINT_PATH_INDENT    "%i %d %D %t %T %o"
>  #define PRINT_PATH_CHECKER   "%i %d %D %p %t %T %o %C"
>  #define PRINT_MAP_STATUS     "%n %F %Q %N %t %r"
>  #define PRINT_MAP_STATS      "%n %0 %1 %2 %3 %4"
>  #define PRINT_MAP_NAMES      "%n %d %w"
> -#define PRINT_MAP_PROPS      "size=%S features='%f' hwhandler='%h' wp=%r"
> -#define PRINT_PG_INDENT      "policy='%s' prio=%p status=%t"
> -
> -#define PRINT_JSON_MULTIPLIER     5
> -#define PRINT_JSON_MAJOR_VERSION  0
> -#define PRINT_JSON_MINOR_VERSION  1
> -#define PRINT_JSON_START_VERSION  "   \"major_version\": %d,\n" \
> -				  "   \"minor_version\": %d,\n"
> -#define PRINT_JSON_START_ELEM     "{\n"
> -#define PRINT_JSON_START_MAP      "   \"map\":"
> -#define PRINT_JSON_START_MAPS     "\"maps\": ["
> -#define PRINT_JSON_START_PATHS    "\"paths\": ["
> -#define PRINT_JSON_START_GROUPS   "\"path_groups\": ["
> -#define PRINT_JSON_END_ELEM       "},"
> -#define PRINT_JSON_END_LAST_ELEM  "}"
> -#define PRINT_JSON_END_LAST       "}\n"
> -#define PRINT_JSON_END_ARRAY      "]\n"
> -#define PRINT_JSON_INDENT_N    3
> -#define PRINT_JSON_MAP       "{\n" \
> -			     "      \"name\" : \"%n\",\n" \
> -			     "      \"uuid\" : \"%w\",\n" \
> -			     "      \"sysfs\" : \"%d\",\n" \
> -			     "      \"failback\" : \"%F\",\n" \
> -			     "      \"queueing\" : \"%Q\",\n" \
> -			     "      \"paths\" : %N,\n" \
> -			     "      \"write_prot\" : \"%r\",\n" \
> -			     "      \"dm_st\" : \"%t\",\n" \
> -			     "      \"features\" : \"%f\",\n" \
> -			     "      \"hwhandler\" : \"%h\",\n" \
> -			     "      \"action\" : \"%A\",\n" \
> -			     "      \"path_faults\" : %0,\n" \
> -			     "      \"vend\" : \"%v\",\n" \
> -			     "      \"prod\" : \"%p\",\n" \
> -			     "      \"rev\" : \"%e\",\n" \
> -			     "      \"switch_grp\" : %1,\n" \
> -			     "      \"map_loads\" : %2,\n" \
> -			     "      \"total_q_time\" : %3,\n" \
> -			     "      \"q_timeouts\" : %4,"
> -
> -#define PRINT_JSON_GROUP     "{\n" \
> -			     "         \"selector\" : \"%s\",\n" \
> -			     "         \"pri\" : %p,\n" \
> -			     "         \"dm_st\" : \"%t\",\n" \
> -			     "         \"marginal_st\" : \"%M\","
>  
> -#define PRINT_JSON_GROUP_NUM "         \"group\" : %d,\n"
> -
> -#define PRINT_JSON_PATH      "{\n" \
> -			     "            \"dev\" : \"%d\",\n"\
> -			     "            \"dev_t\" : \"%D\",\n" \
> -			     "            \"dm_st\" : \"%t\",\n" \
> -			     "            \"dev_st\" : \"%o\",\n" \
> -			     "            \"chk_st\" : \"%T\",\n" \
> -			     "            \"checker\" : \"%c\",\n" \
> -			     "            \"pri\" : %p,\n" \
> -			     "            \"host_wwnn\" : \"%N\",\n" \
> -			     "            \"target_wwnn\" : \"%n\",\n" \
> -			     "            \"host_wwpn\" : \"%R\",\n" \
> -			     "            \"target_wwpn\" : \"%r\",\n" \
> -			     "            \"host_adapter\" : \"%a\",\n" \
> -			     "            \"marginal_st\" : \"%M\""
> -
> -#define MAX_LINE_LEN  80
> -#define MAX_LINES     64
> -#define MAX_FIELD_LEN 128
> -#define PROGRESS_LEN  10
> +struct strbuf;
>  
>  struct path_data {
>  	char wildcard;
> -- 
> 2.32.0

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2021-07-29  2:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 10:52 [dm-devel] [PATCH 0/9] multipath-tools: use variable-size string buffers mwilck
2021-07-15 10:52 ` [dm-devel] [PATCH 1/9] libmultipath: variable-size parameters in dm_get_map() mwilck
2021-07-26 22:17   ` Benjamin Marzinski
2021-08-11 14:18     ` Martin Wilck
2021-07-15 10:52 ` [dm-devel] [PATCH 2/9] libmultipath: strbuf: simple api for growing string buffers mwilck
2021-07-27  4:54   ` Benjamin Marzinski
2021-08-11 15:03     ` Martin Wilck
2021-07-15 10:52 ` [dm-devel] [PATCH 3/9] libmultipath: variable-size parameters in assemble_map() mwilck
2021-07-28 15:54   ` Benjamin Marzinski
2021-08-11 15:15     ` Martin Wilck
2021-07-15 10:52 ` [dm-devel] [PATCH 4/9] libmultipath: use strbuf in dict.c mwilck
2021-07-28 19:03   ` Benjamin Marzinski
2021-08-11 15:27     ` Martin Wilck
2021-08-30 18:23       ` Benjamin Marzinski
2021-07-15 10:52 ` [dm-devel] [PATCH 5/9] libmultipath: use strbuf in print.c mwilck
2021-07-29  0:00   ` Benjamin Marzinski
2021-07-15 10:52 ` [dm-devel] [PATCH 6/9] libmultipath: print.c: fail hard if keywords are not found mwilck
2021-07-29  2:36   ` Benjamin Marzinski
2021-07-15 10:52 ` [dm-devel] [PATCH 7/9] libmultipath: print.h: move macros to print.c mwilck
2021-07-29  2:36   ` Benjamin Marzinski [this message]
2021-07-15 10:52 ` [dm-devel] [PATCH 8/9] libmultipath: use strbuf in alias.c mwilck
2021-07-29 15:22   ` Benjamin Marzinski
2021-07-15 10:52 ` [dm-devel] [PATCH 9/9] multipathd: use strbuf in cli.c mwilck
2021-07-29 15:46   ` Benjamin Marzinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210729023655.GO3087@octiron.msp.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=mwilck@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).