[ovs-dev] [PATCH 2/2] ovn-nbctl: Clarify error messages in qos-add command.

Justin Pettit jpettit at ovn.org
Tue Jul 10 05:17:35 UTC 2018


Thanks for the review.  I pushed these to master (and fixed a test failure that the original versions introduced.)

--Justin


> On Jul 9, 2018, at 2:39 PM, Yifeng Sun <pkusunyifeng at gmail.com> wrote:
> 
> Looks good to me, thanks.
> 
> Reviewed-by: Yifeng Sun <pkusunyifeng at gmail.com>
> 
> On Sat, Jul 7, 2018 at 2:11 PM, Justin Pettit <jpettit at ovn.org> wrote:
> Signed-off-by: Justin Pettit <jpettit at ovn.org>
> ---
>  ovn/utilities/ovn-nbctl.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
> index fbdb5a4d9ae9..5638b0a197e0 100644
> --- a/ovn/utilities/ovn-nbctl.c
> +++ b/ovn/utilities/ovn-nbctl.c
> @@ -1761,14 +1761,15 @@ nbctl_qos_add(struct ctl_context *ctx)
>          if (!strncmp(ctx->argv[i], "dscp=", 5)) {
>              if (!ovs_scan(ctx->argv[i] + 5, "%"SCNd64, &dscp)
>                  || dscp < 0 || dscp > 63) {
> -                ctl_fatal("%s: dscp must in range 0...63.", ctx->argv[i] + 5);
> +                ctl_fatal("%s: dscp must be in the range 0...63",
> +                          ctx->argv[i] + 5);
>                  return;
>              }
>          }
>          else if (!strncmp(ctx->argv[i], "rate=", 5)) {
>              if (!ovs_scan(ctx->argv[i] + 5, "%"SCNd64, &rate)
>                  || rate < 1 || rate > UINT32_MAX) {
> -                ctl_fatal("%s: rate must in range 1...4294967295.",
> +                ctl_fatal("%s: rate must be in the range 1...4294967295.",
>                            ctx->argv[i] + 5);
>                  return;
>              }
> @@ -1776,20 +1777,20 @@ nbctl_qos_add(struct ctl_context *ctx)
>          else if (!strncmp(ctx->argv[i], "burst=", 6)) {
>              if (!ovs_scan(ctx->argv[i] + 6, "%"SCNd64, &burst)
>                  || burst < 1 || burst > UINT32_MAX) {
> -                ctl_fatal("%s: burst must in range 1...4294967295.",
> +                ctl_fatal("%s: burst must be in the range 1...4294967295.",
>                            ctx->argv[i] + 6);
>                  return;
>              }
>          } else {
> -            ctl_fatal("%s: must be start of \"dscp=\", \"rate=\", \"burst=\".",
> -                      ctx->argv[i]);
> +            ctl_fatal("%s: supported arguments are \"dscp=\", \"rate=\", "
> +                      "and \"burst=\"", ctx->argv[i]);
>              return;
>          }
>      }
> 
>      /* Validate rate and dscp. */
>      if (-1 == dscp && !rate) {
> -        ctl_fatal("One of the rate or dscp must be configured.");
> +        ctl_fatal("Either \"rate\" and/or \"dscp\" must be specified");
>          return;
>      }
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> 



More information about the dev mailing list