On 12/01/2017 09:33, "Ben Pfaff" <[email protected]> wrote:

>On Thu, Jan 12, 2017 at 12:23:55AM -0800, Daniele Di Proietto wrote:
>> set_tunnel_config() always logs a warning, even on success. This
>> shouldn't happen.
>> 
>> Without this, some unit tests fail.
>> 
>> Fixes: 9fff138ec3a6("netdev: Add 'errp' to set_config().")
>> Signed-off-by: Daniele Di Proietto <[email protected]>
>> ---
>>  lib/netdev-vport.c | 10 ++++++----
>>  1 file changed, 6 insertions(+), 4 deletions(-)
>> 
>> diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
>> index ad5ffcc81..2db51df72 100644
>> --- a/lib/netdev-vport.c
>> +++ b/lib/netdev-vport.c
>> @@ -561,10 +561,12 @@ set_tunnel_config(struct netdev *dev_, const struct 
>> smap *args, char **errp)
>>      err = 0;
>>  
>>  out:
>> -    ds_chomp(&errors, '\n');
>> -    VLOG_WARN("%s", ds_cstr(&errors));
>> -    if (err) {
>> -        *errp = ds_steal_cstr(&errors);
>> +    if (*ds_cstr(&errors)) {
>
>How about "if (errors.length)" instead?

Ok

>
>> +        ds_chomp(&errors, '\n');
>> +        VLOG_WARN("%s", ds_cstr(&errors));
>> +        if (err) {
>> +            *errp = ds_steal_cstr(&errors);
>> +        }
>>      }
>>  
>>      ds_destroy(&errors);
>
>Acked-by: Ben Pfaff <[email protected]>

Thanks, pushed to master
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to