diff mbox

[ovs-dev] bridge: No QoS configured is not an error

Message ID 1470145707-21885-1-git-send-email-maxime.coquelin@redhat.com
State Accepted
Headers show

Commit Message

Maxime Coquelin Aug. 2, 2016, 1:48 p.m. UTC
If no QoS is configured, type value is likely to be an empty
string.

This is not an error though, so use the regular command reply
function, not the error one.

For example, before this patch:
  # ovs-appctl -t ovs-vswitchd qos/show vhost-user1
  QoS not configured on vhost-user1
  ovs-appctl: ovs-vswitchd: server returned an error

After the patch:
  # ovs-appctl -t ovs-vswitchd qos/show vhost-user1
  QoS not configured on vhost-user1

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 vswitchd/bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stokes, Ian Aug. 2, 2016, 3:27 p.m. UTC | #1
> If no QoS is configured, type value is likely to be an empty string.

> 

> This is not an error though, so use the regular command reply function,

> not the error one.

> 

> For example, before this patch:

>   # ovs-appctl -t ovs-vswitchd qos/show vhost-user1

>   QoS not configured on vhost-user1

>   ovs-appctl: ovs-vswitchd: server returned an error

> 

> After the patch:

>   # ovs-appctl -t ovs-vswitchd qos/show vhost-user1

>   QoS not configured on vhost-user1

> 

> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>

> ---

>  vswitchd/bridge.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index

> 07f7b55..ddf1fe5 100644

> --- a/vswitchd/bridge.c

> +++ b/vswitchd/bridge.c

> @@ -3199,7 +3199,7 @@ qos_unixctl_show(struct unixctl_conn *conn, int

> argc OVS_UNUSED,

>              unixctl_command_reply(conn, ds_cstr(&ds));

>          } else {

>              ds_put_format(&ds, "QoS not configured on %s\n", iface-

> >name);

> -            unixctl_command_reply_error(conn, ds_cstr(&ds));

> +            unixctl_command_reply(conn, ds_cstr(&ds));

>          }

>      } else {

>          ds_put_format(&ds, "%s: failed to retrieve QOS configuration

> (%s)\n",

> --

> 2.7.4

> 

Thanks for the patch Maxime, looks good to me.

Acked-by: Ian Stokes <ian.stokes@intel.com>
Daniele Di Proietto Aug. 5, 2016, 1:24 a.m. UTC | #2
Applied to master, thanks

2016-08-02 8:27 GMT-07:00 Stokes, Ian <ian.stokes@intel.com>:

> > If no QoS is configured, type value is likely to be an empty string.
> >
> > This is not an error though, so use the regular command reply function,
> > not the error one.
> >
> > For example, before this patch:
> >   # ovs-appctl -t ovs-vswitchd qos/show vhost-user1
> >   QoS not configured on vhost-user1
> >   ovs-appctl: ovs-vswitchd: server returned an error
> >
> > After the patch:
> >   # ovs-appctl -t ovs-vswitchd qos/show vhost-user1
> >   QoS not configured on vhost-user1
> >
> > Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> > ---
> >  vswitchd/bridge.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index
> > 07f7b55..ddf1fe5 100644
> > --- a/vswitchd/bridge.c
> > +++ b/vswitchd/bridge.c
> > @@ -3199,7 +3199,7 @@ qos_unixctl_show(struct unixctl_conn *conn, int
> > argc OVS_UNUSED,
> >              unixctl_command_reply(conn, ds_cstr(&ds));
> >          } else {
> >              ds_put_format(&ds, "QoS not configured on %s\n", iface-
> > >name);
> > -            unixctl_command_reply_error(conn, ds_cstr(&ds));
> > +            unixctl_command_reply(conn, ds_cstr(&ds));
> >          }
> >      } else {
> >          ds_put_format(&ds, "%s: failed to retrieve QOS configuration
> > (%s)\n",
> > --
> > 2.7.4
> >
> Thanks for the patch Maxime, looks good to me.
>
> Acked-by: Ian Stokes <ian.stokes@intel.com>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
diff mbox

Patch

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 07f7b55..ddf1fe5 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -3199,7 +3199,7 @@  qos_unixctl_show(struct unixctl_conn *conn, int argc OVS_UNUSED,
             unixctl_command_reply(conn, ds_cstr(&ds));
         } else {
             ds_put_format(&ds, "QoS not configured on %s\n", iface->name);
-            unixctl_command_reply_error(conn, ds_cstr(&ds));
+            unixctl_command_reply(conn, ds_cstr(&ds));
         }
     } else {
         ds_put_format(&ds, "%s: failed to retrieve QOS configuration (%s)\n",