diff mbox series

[3/7] libmultipath: print all values in snprint_failback

Message ID 20240513173646.94424-4-bmarzins@redhat.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath-tools man pages: add missing information | expand

Commit Message

Benjamin Marzinski May 13, 2024, 5:36 p.m. UTC
Add the missing output for manual failback and print the defferral time
for deferred failbacks, if one isn't currently in progress.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/print.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Martin Wilck May 24, 2024, 1:43 p.m. UTC | #1
On Mon, 2024-05-13 at 13:36 -0400, Benjamin Marzinski wrote:
> Add the missing output for manual failback and print the defferral
> time
> for deferred failbacks, if one isn't currently in progress.
> 
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
>  libmultipath/print.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/libmultipath/print.c b/libmultipath/print.c
> index 89813517..14e7e325 100644
> --- a/libmultipath/print.c
> +++ b/libmultipath/print.c
> @@ -218,9 +218,13 @@ snprint_failback (struct strbuf *buff, const
> struct multipath * mpp)
>  		return append_strbuf_str(buff, "immediate");
>  	if (mpp->pgfailback == -FAILBACK_FOLLOWOVER)
>  		return append_strbuf_str(buff, "followover");
> +	if (mpp->pgfailback == -FAILBACK_MANUAL)
> +		return append_strbuf_str(buff, "manual");
> +	if (mpp->pgfailback == FAILBACK_UNDEF)
> +		return append_strbuf_str(buff, "undef");
>  
>  	if (!mpp->failback_tick)
> -		return append_strbuf_str(buff, "-");
> +		return print_strbuf(buff, "%i", mpp->pgfailback);

Perhaps we should print something like "delayed:%i" here?

Martin



>  	else
>  		return snprint_progress(buff, mpp->failback_tick,
>  					mpp->pgfailback);
Benjamin Marzinski May 29, 2024, 3:03 p.m. UTC | #2
On Fri, May 24, 2024 at 03:43:44PM +0200, Martin Wilck wrote:
> On Mon, 2024-05-13 at 13:36 -0400, Benjamin Marzinski wrote:
> > Add the missing output for manual failback and print the defferral
> > time
> > for deferred failbacks, if one isn't currently in progress.
> > 
> > Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> > ---
> >  libmultipath/print.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libmultipath/print.c b/libmultipath/print.c
> > index 89813517..14e7e325 100644
> > --- a/libmultipath/print.c
> > +++ b/libmultipath/print.c
> > @@ -218,9 +218,13 @@ snprint_failback (struct strbuf *buff, const
> > struct multipath * mpp)
> >  		return append_strbuf_str(buff, "immediate");
> >  	if (mpp->pgfailback == -FAILBACK_FOLLOWOVER)
> >  		return append_strbuf_str(buff, "followover");
> > +	if (mpp->pgfailback == -FAILBACK_MANUAL)
> > +		return append_strbuf_str(buff, "manual");
> > +	if (mpp->pgfailback == FAILBACK_UNDEF)
> > +		return append_strbuf_str(buff, "undef");
> >  
> >  	if (!mpp->failback_tick)
> > -		return append_strbuf_str(buff, "-");
> > +		return print_strbuf(buff, "%i", mpp->pgfailback);
> 
> Perhaps we should print something like "delayed:%i" here?

Sure.

> 
> Martin
> 
> 
> 
> >  	else
> >  		return snprint_progress(buff, mpp->failback_tick,
> >  					mpp->pgfailback);
diff mbox series

Patch

diff --git a/libmultipath/print.c b/libmultipath/print.c
index 89813517..14e7e325 100644
--- a/libmultipath/print.c
+++ b/libmultipath/print.c
@@ -218,9 +218,13 @@  snprint_failback (struct strbuf *buff, const struct multipath * mpp)
 		return append_strbuf_str(buff, "immediate");
 	if (mpp->pgfailback == -FAILBACK_FOLLOWOVER)
 		return append_strbuf_str(buff, "followover");
+	if (mpp->pgfailback == -FAILBACK_MANUAL)
+		return append_strbuf_str(buff, "manual");
+	if (mpp->pgfailback == FAILBACK_UNDEF)
+		return append_strbuf_str(buff, "undef");
 
 	if (!mpp->failback_tick)
-		return append_strbuf_str(buff, "-");
+		return print_strbuf(buff, "%i", mpp->pgfailback);
 	else
 		return snprint_progress(buff, mpp->failback_tick,
 					mpp->pgfailback);