diff mbox series

[ovs-dev] ovsdb-idlc: Return expected sequence number while setting conditions.

Message ID 20201110121811.2205350-1-i.maximets@ovn.org
State Accepted
Headers show
Series [ovs-dev] ovsdb-idlc: Return expected sequence number while setting conditions. | expand

Commit Message

Ilya Maximets Nov. 10, 2020, 12:18 p.m. UTC
ovsdb_idl_set_condition() returns a sequence number that can be used to
check if the requested conditions are acknowledged by the server.
However, database bindings do not return this value to the user, making
it impossible to check if the conditions are accepted.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 ovsdb/ovsdb-idlc.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Dumitru Ceara Nov. 10, 2020, 1:45 p.m. UTC | #1
On 11/10/20 1:18 PM, Ilya Maximets wrote:
> ovsdb_idl_set_condition() returns a sequence number that can be used to
> check if the requested conditions are acknowledged by the server.
> However, database bindings do not return this value to the user, making
> it impossible to check if the conditions are accepted.
> 
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>

Hi Ilya,

This change looks OK to me:

Acked-by: Dumitru Ceara <dceara@redhat.com>

It did uncover another bug in ovsdb_idl_db_condition_set() but I'll send
a separate patch for that.

Thanks,
Dumitru

> ---
>  ovsdb/ovsdb-idlc.in | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
> index 698fe25f3..b13195606 100755
> --- a/ovsdb/ovsdb-idlc.in
> +++ b/ovsdb/ovsdb-idlc.in
> @@ -389,7 +389,7 @@ bool %(s)s_is_updated(const struct %(s)s *, enum %(s)s_column_id);
>                  args = ['%(type)s%(name)s' % member for member in members]
>              print('%s);' % ', '.join(args))
>  
> -            print('void %(s)s_set_condition(struct ovsdb_idl *, struct ovsdb_idl_condition *);' % {'s': structName})
> +            print('unsigned int %(s)s_set_condition(struct ovsdb_idl *, struct ovsdb_idl_condition *);' % {'s': structName})
>  
>          print("")
>  
> @@ -1416,10 +1416,10 @@ struct %(s)s *
>          print("\nstruct ovsdb_idl_column %s_columns[%s_N_COLUMNS];" % (
>              structName, structName.upper()))
>          print("""
> -void
> +unsigned int
>  %(s)s_set_condition(struct ovsdb_idl *idl, struct ovsdb_idl_condition *condition)
>  {
> -    ovsdb_idl_set_condition(idl, &%(p)stable_%(tl)s, condition);
> +    return ovsdb_idl_set_condition(idl, &%(p)stable_%(tl)s, condition);
>  }""" % {'p': prefix,
>          's': structName,
>          'tl': tableName.lower()})
>
Ilya Maximets Nov. 16, 2020, 7:18 p.m. UTC | #2
On 11/10/20 2:45 PM, Dumitru Ceara wrote:
> On 11/10/20 1:18 PM, Ilya Maximets wrote:
>> ovsdb_idl_set_condition() returns a sequence number that can be used to
>> check if the requested conditions are acknowledged by the server.
>> However, database bindings do not return this value to the user, making
>> it impossible to check if the conditions are accepted.
>>
>> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> 
> Hi Ilya,
> 
> This change looks OK to me:
> 
> Acked-by: Dumitru Ceara <dceara@redhat.com>


Thanks!
Applied to master.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
index 698fe25f3..b13195606 100755
--- a/ovsdb/ovsdb-idlc.in
+++ b/ovsdb/ovsdb-idlc.in
@@ -389,7 +389,7 @@  bool %(s)s_is_updated(const struct %(s)s *, enum %(s)s_column_id);
                 args = ['%(type)s%(name)s' % member for member in members]
             print('%s);' % ', '.join(args))
 
-            print('void %(s)s_set_condition(struct ovsdb_idl *, struct ovsdb_idl_condition *);' % {'s': structName})
+            print('unsigned int %(s)s_set_condition(struct ovsdb_idl *, struct ovsdb_idl_condition *);' % {'s': structName})
 
         print("")
 
@@ -1416,10 +1416,10 @@  struct %(s)s *
         print("\nstruct ovsdb_idl_column %s_columns[%s_N_COLUMNS];" % (
             structName, structName.upper()))
         print("""
-void
+unsigned int
 %(s)s_set_condition(struct ovsdb_idl *idl, struct ovsdb_idl_condition *condition)
 {
-    ovsdb_idl_set_condition(idl, &%(p)stable_%(tl)s, condition);
+    return ovsdb_idl_set_condition(idl, &%(p)stable_%(tl)s, condition);
 }""" % {'p': prefix,
         's': structName,
         'tl': tableName.lower()})