[ovs-git] [openvswitch/ovs] 9b03e5: ovsdb-idlc: Use ovsdb_datum_from_smap() instead of...

GitHub noreply at github.com
Wed Oct 19 18:39:55 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 9b03e59d208ebb65a62b2147849c574aea0bf68d
      https://github.com/openvswitch/ovs/commit/9b03e59d208ebb65a62b2147849c574aea0bf68d
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M lib/ovsdb-data.c
    M lib/ovsdb-data.h
    M ovsdb/ovsdb-idlc.in
    M vswitchd/bridge.c

  Log Message:
  -----------
  ovsdb-idlc: Use ovsdb_datum_from_smap() instead of open-coding it.

There's no reason to have three copies of this code for every smap-type
column.

The code wasn't a perfect match for ovsdb_datum_from_smap(), so this commit
also changes ovsdb_datum_from_smap() to better suit it.  It only had one
caller and the new design is adequate for that caller.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: 864c5bc89a697feac1cec0f421871ebae4309b2a
      https://github.com/openvswitch/ovs/commit/864c5bc89a697feac1cec0f421871ebae4309b2a
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M ovsdb/ovsdb-idlc.1
    M ovsdb/ovsdb-idlc.in

  Log Message:
  -----------
  ovsdb-idlc: Remove obsolete documentation and usage.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: e0b1744ffa87c22c35745701be8ce55ccc92c87c
      https://github.com/openvswitch/ovs/commit/e0b1744ffa87c22c35745701be8ce55ccc92c87c
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M ovsdb/ovsdb-idlc.in

  Log Message:
  -----------
  ovsdb-idlc: Factor out sorting columns.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: cff5afcfcc8be30413cb024ce5b29c2693f7f971
      https://github.com/openvswitch/ovs/commit/cff5afcfcc8be30413cb024ce5b29c2693f7f971
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M ovsdb/ovsdb-idlc.in

  Log Message:
  -----------
  ovsdb-idlc: Simplify code generation to parse sets and maps of references.

This switches from code that looks like:
    if (keyRow) {
  ...
    }
to:
    if (!keyRow) {
  continue;
    }
    ...
which is a little easier to generate because the indentation of ... is
constant.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: 9478f52f3c4c02d9d1695b902b3903fc9ab51cfc
      https://github.com/openvswitch/ovs/commit/9478f52f3c4c02d9d1695b902b3903fc9ab51cfc
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M ovsdb/ovsdb-idlc.in

  Log Message:
  -----------
  ovsdb-idlc: Make generated references to table classes easier to read.

This replaces &ovsrec_table_classes[OVSREC_TABLE_OPEN_VSWITCH] by the
easier to read and equivalent &ovsrec_table_open_vswitch in generated code.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: 1f2d2557f19ecf899a4ea7e04fb6e3883c8eb071
      https://github.com/openvswitch/ovs/commit/1f2d2557f19ecf899a4ea7e04fb6e3883c8eb071
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M ovsdb/ovsdb-idlc.in

  Log Message:
  -----------
  ovsdb-idlc: Make generated references to columns easier to read.

This replaces ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_CUR_CFG]
by the easier to read and equivalent ovsrec_open_vswitch_col_cur_cfg in
generated code.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: cb9d556ff97726ae2d79924a3547eec0e6cb7b11
      https://github.com/openvswitch/ovs/commit/cb9d556ff97726ae2d79924a3547eec0e6cb7b11
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M ovsdb/ovsdb-idlc.in

  Log Message:
  -----------
  ovsdb-idlc: Declare loop variables in for statements in generated code.

This changes several instances of
    size_t i;
    for (i = 0; i < ...; i++)
into:
    for (size_t i = 0; i < ...; i++)
in generated code, making it slightly more compact and easier to read.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: cad9a9966afe0cf4aaa5d00d98d090c06fc5f9ad
      https://github.com/openvswitch/ovs/commit/cad9a9966afe0cf4aaa5d00d98d090c06fc5f9ad
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M ovsdb/ovsdb-idlc.in

  Log Message:
  -----------
  ovsdb-idlc: Consolidate assertions.

There were lots of bits of code emitting "assert(inited);".  This combines
many of them.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: 74e98efd3e2f4168e50d46fe4635678a0bab3b80
      https://github.com/openvswitch/ovs/commit/74e98efd3e2f4168e50d46fe4635678a0bab3b80
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M ovn/controller-vtep/ovn-controller-vtep.c
    M ovn/controller/ovn-controller.c
    M ovn/northd/ovn-northd.c
    M ovn/utilities/ovn-nbctl.c
    M ovn/utilities/ovn-sbctl.c
    M ovn/utilities/ovn-trace.c
    M ovsdb/ovsdb-idlc.in
    M python/ovs/db/data.py
    M python/ovs/db/types.py
    M python/ovs/ovsuuid.py
    M tests/test-ovsdb.c
    M utilities/ovs-vsctl.c
    M vswitchd/ovs-vswitchd.c
    M vtep/vtep-ctl.c

  Log Message:
  -----------
  ovsdb-idlc: Eliminate <prefix>_init() function from generated code.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: 36f4c3c8fae7f4c5567536954781f623026017db
      https://github.com/openvswitch/ovs/commit/36f4c3c8fae7f4c5567536954781f623026017db
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M lib/ovsdb-idl.c

  Log Message:
  -----------
  ovsdb-idl: Improve comment on ovsdb_idl_txn_write[_clone]().

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: aa8628aa9f8821a2ddac784349e028b6132dc00b
      https://github.com/openvswitch/ovs/commit/aa8628aa9f8821a2ddac784349e028b6132dc00b
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M lib/ovsdb-idl.c
    M ovsdb/ovsdb-idlc.in

  Log Message:
  -----------
  ovsdb-idl: Sort and unique-ify datum in ovsdb_idl_txn_write().

I noticed that there were lots of calls to ovsdb_datum_sort_unique() from
"set" functions in generated IDL code.  This moves that call into common
code, reducing redundancy.

There are more calls to the same function that are a little harder to
remove.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: 8b300b7905264fcfd09d8acfddcbd45f8e4d159f
      https://github.com/openvswitch/ovs/commit/8b300b7905264fcfd09d8acfddcbd45f8e4d159f
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M ovsdb/ovsdb-idlc.in

  Log Message:
  -----------
  ovsdb-idlc: Remove special case for "sizeof bool".

The "sparse" checker used to warn about sizeof(bool).  These days, it does
not warn (without -Wsizeof-bool), so remove this ugly special case.

If you have a version of "sparse" that still warns by default, please
upgrade to a version that includes commit 2667c2d4ab33 (sparse: Allow
override of sizeof(bool) warning).

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: c1ac745c3f694ac18a711c326410c8a87695a0b6
      https://github.com/openvswitch/ovs/commit/c1ac745c3f694ac18a711c326410c8a87695a0b6
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M lib/ovsdb-idl-provider.h
    M lib/ovsdb-idl.c

  Log Message:
  -----------
  ovsdb-idl: Add some more implementation comments.

I wrote this code and if I have to rediscover how it works, it's time to
improve the commnts.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: 012d37621ae0ab2447578c234f2360733f41058e
      https://github.com/openvswitch/ovs/commit/012d37621ae0ab2447578c234f2360733f41058e
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M lib/ovsdb-idl-provider.h
    M lib/ovsdb-idl.c

  Log Message:
  -----------
  ovsdb-idl: Mark ovsdb_idl_get_row_arc() parameter const.

This function doesn't modify its 'dst_table' parameter, so it might as well
be marked const.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


  Commit: 11990a5274f7411eb5a07f6accef9f17d32eb7e4
      https://github.com/openvswitch/ovs/commit/11990a5274f7411eb5a07f6accef9f17d32eb7e4
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2016-10-19 (Wed, 19 Oct 2016)

  Changed paths:
    M lib/ovsdb-idl.c
    M lib/ovsdb-idl.h
    M tests/test-ovsdb.c

  Log Message:
  -----------
  ovsdb-idl: Check internal graph in OVSDB tests.

Some upcoming tests will add extra trickiness to the IDL internal graph.
This worries me, because the IDL doesn't have any checks for its graph
consistency.  This commit adds some.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Andy Zhou <azhou at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/7e1ffe3c4136...11990a5274f7


More information about the git mailing list