diff mbox

[ovs-dev,05/27] ovn-sbctl, ovn-nbctl, ovs-vsctl: Remove useless record id methods.

Message ID CA+0q_PipHdFg_yqjQSPPZtZ6kae_4mnbRSa6+gWCQhpNrj0dYA@mail.gmail.com
State Not Applicable
Headers show

Commit Message

Russell Bryant May 2, 2017, 8:30 p.m. UTC
On Sun, Apr 30, 2017 at 7:22 PM, Ben Pfaff <blp@ovn.org> wrote:
> These only did anything if both the first two members of the struct were
> nonnull, as you can see from the first test in get_row_by_id() in
> lib/db-ctl-base.c, so these never did anything useful and I can't figure
> out why they're there.
>
> Signed-off-by: Ben Pfaff <blp@ovn.org>
> ---
>  ovn/utilities/ovn-nbctl.c |  3 ---
>  ovn/utilities/ovn-sbctl.c |  7 -------
>  utilities/ovs-vsctl.c     | 16 +++++-----------
>  3 files changed, 5 insertions(+), 21 deletions(-)

This doesn't compile for me.

> diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
> index 84176dea99d3..ed2145538e6f 100644
> --- a/utilities/ovs-vsctl.c
> +++ b/utilities/ovs-vsctl.c
> @@ -2291,10 +2291,8 @@ cmd_get_aa_mapping(struct ctl_context *ctx)
>
>
>  static const struct ctl_table_class tables[OVSREC_N_TABLES] = {
> -    [OVSREC_TABLE_BRIDGE].row_ids = {
> -        {&ovsrec_table_bridge, &ovsrec_bridge_col_name, NULL},
> -        {&ovsrec_table_flow_sample_collector_set, NULL,
> -         &ovsrec_flow_sample_collector_set_col_bridge}},
> +    [OVSREC_TABLE_BRIDGE].row_ids[0] = {
> +        {&ovsrec_table_bridge, &ovsrec_bridge_col_name, NULL}},
>
>      [OVSREC_TABLE_CONTROLLER].row_ids[0]
>      = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
> @@ -2319,9 +2317,6 @@ static const struct ctl_table_class tables[OVSREC_N_TABLES] = {
>      [OVSREC_TABLE_QOS].row_ids[0]
>      = {&ovsrec_table_port, &ovsrec_port_col_name, &ovsrec_port_col_qos},
>
> -    [OVSREC_TABLE_SSL].row_ids[0]
> -    = {&ovsrec_table_open_vswitch, NULL, &ovsrec_open_vswitch_col_ssl},
> -
>      [OVSREC_TABLE_SFLOW].row_ids[0]
>      = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
>         &ovsrec_bridge_col_sflow},
> @@ -2329,10 +2324,9 @@ static const struct ctl_table_class tables[OVSREC_N_TABLES] = {
>      [OVSREC_TABLE_FLOW_TABLE].row_ids[0]
>      = {&ovsrec_table_flow_table, &ovsrec_flow_table_col_name, NULL},
>
> -    [OVSREC_TABLE_IPFIX].row_ids = {
> -     {&ovsrec_table_bridge, &ovsrec_bridge_col_name, &ovsrec_bridge_col_ipfix},
> -     {&ovsrec_table_flow_sample_collector_set, NULL,
> -      &ovsrec_flow_sample_collector_set_col_ipfix}},
> +    [OVSREC_TABLE_IPFIX].row_ids[0] = {
> +     {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
> +      &ovsrec_bridge_col_ipfix}},
>
>      [OVSREC_TABLE_AUTOATTACH].row_ids[0]
>      = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,

Acked-by: Russell Bryant <russell@ovn.org>

with the build fix:

     = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,

Comments

Russell Bryant May 2, 2017, 8:34 p.m. UTC | #1
On Tue, May 2, 2017 at 4:30 PM, Russell Bryant <russell@ovn.org> wrote:
> On Sun, Apr 30, 2017 at 7:22 PM, Ben Pfaff <blp@ovn.org> wrote:
>> These only did anything if both the first two members of the struct were
>> nonnull, as you can see from the first test in get_row_by_id() in
>> lib/db-ctl-base.c, so these never did anything useful and I can't figure
>> out why they're there.
>>
>> Signed-off-by: Ben Pfaff <blp@ovn.org>
>> ---
>>  ovn/utilities/ovn-nbctl.c |  3 ---
>>  ovn/utilities/ovn-sbctl.c |  7 -------
>>  utilities/ovs-vsctl.c     | 16 +++++-----------
>>  3 files changed, 5 insertions(+), 21 deletions(-)
>
> This doesn't compile for me.

though I see now that the next patch fixes it, so either fix the build
here or wait for the ack on the next one before applying.

>
>> diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
>> index 84176dea99d3..ed2145538e6f 100644
>> --- a/utilities/ovs-vsctl.c
>> +++ b/utilities/ovs-vsctl.c
>> @@ -2291,10 +2291,8 @@ cmd_get_aa_mapping(struct ctl_context *ctx)
>>
>>
>>  static const struct ctl_table_class tables[OVSREC_N_TABLES] = {
>> -    [OVSREC_TABLE_BRIDGE].row_ids = {
>> -        {&ovsrec_table_bridge, &ovsrec_bridge_col_name, NULL},
>> -        {&ovsrec_table_flow_sample_collector_set, NULL,
>> -         &ovsrec_flow_sample_collector_set_col_bridge}},
>> +    [OVSREC_TABLE_BRIDGE].row_ids[0] = {
>> +        {&ovsrec_table_bridge, &ovsrec_bridge_col_name, NULL}},
>>
>>      [OVSREC_TABLE_CONTROLLER].row_ids[0]
>>      = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
>> @@ -2319,9 +2317,6 @@ static const struct ctl_table_class tables[OVSREC_N_TABLES] = {
>>      [OVSREC_TABLE_QOS].row_ids[0]
>>      = {&ovsrec_table_port, &ovsrec_port_col_name, &ovsrec_port_col_qos},
>>
>> -    [OVSREC_TABLE_SSL].row_ids[0]
>> -    = {&ovsrec_table_open_vswitch, NULL, &ovsrec_open_vswitch_col_ssl},
>> -
>>      [OVSREC_TABLE_SFLOW].row_ids[0]
>>      = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
>>         &ovsrec_bridge_col_sflow},
>> @@ -2329,10 +2324,9 @@ static const struct ctl_table_class tables[OVSREC_N_TABLES] = {
>>      [OVSREC_TABLE_FLOW_TABLE].row_ids[0]
>>      = {&ovsrec_table_flow_table, &ovsrec_flow_table_col_name, NULL},
>>
>> -    [OVSREC_TABLE_IPFIX].row_ids = {
>> -     {&ovsrec_table_bridge, &ovsrec_bridge_col_name, &ovsrec_bridge_col_ipfix},
>> -     {&ovsrec_table_flow_sample_collector_set, NULL,
>> -      &ovsrec_flow_sample_collector_set_col_ipfix}},
>> +    [OVSREC_TABLE_IPFIX].row_ids[0] = {
>> +     {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
>> +      &ovsrec_bridge_col_ipfix}},
>>
>>      [OVSREC_TABLE_AUTOATTACH].row_ids[0]
>>      = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
>
> Acked-by: Russell Bryant <russell@ovn.org>
>
> with the build fix:
>
> diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
> index ed21455..e6bb43f 100644
> --- a/utilities/ovs-vsctl.c
> +++ b/utilities/ovs-vsctl.c
> @@ -2291,8 +2291,8 @@ cmd_get_aa_mapping(struct ctl_context *ctx)
>
>  ^L
>  static const struct ctl_table_class tables[OVSREC_N_TABLES] = {
> -    [OVSREC_TABLE_BRIDGE].row_ids[0] = {
> -        {&ovsrec_table_bridge, &ovsrec_bridge_col_name, NULL}},
> +    [OVSREC_TABLE_BRIDGE].row_ids[0]
> +    = {&ovsrec_table_bridge, &ovsrec_bridge_col_name, NULL},
>
>      [OVSREC_TABLE_CONTROLLER].row_ids[0]
>      = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
> @@ -2324,9 +2324,9 @@ static const struct ctl_table_class
> tables[OVSREC_N_TABLES] = {
>      [OVSREC_TABLE_FLOW_TABLE].row_ids[0]
>      = {&ovsrec_table_flow_table, &ovsrec_flow_table_col_name, NULL},
>
> -    [OVSREC_TABLE_IPFIX].row_ids[0] = {
> -     {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
> -      &ovsrec_bridge_col_ipfix}},
> +    [OVSREC_TABLE_IPFIX].row_ids[0]
> +    = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
> +       &ovsrec_bridge_col_ipfix},
>
>      [OVSREC_TABLE_AUTOATTACH].row_ids[0]
>      = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
Ben Pfaff May 3, 2017, 3:27 p.m. UTC | #2
On Tue, May 02, 2017 at 04:34:44PM -0400, Russell Bryant wrote:
> On Tue, May 2, 2017 at 4:30 PM, Russell Bryant <russell@ovn.org> wrote:
> > On Sun, Apr 30, 2017 at 7:22 PM, Ben Pfaff <blp@ovn.org> wrote:
> >> These only did anything if both the first two members of the struct were
> >> nonnull, as you can see from the first test in get_row_by_id() in
> >> lib/db-ctl-base.c, so these never did anything useful and I can't figure
> >> out why they're there.
> >>
> >> Signed-off-by: Ben Pfaff <blp@ovn.org>
> >> ---
> >>  ovn/utilities/ovn-nbctl.c |  3 ---
> >>  ovn/utilities/ovn-sbctl.c |  7 -------
> >>  utilities/ovs-vsctl.c     | 16 +++++-----------
> >>  3 files changed, 5 insertions(+), 21 deletions(-)
> >
> > This doesn't compile for me.
> 
> though I see now that the next patch fixes it, so either fix the build
> here or wait for the ack on the next one before applying.

Oops!  I actually found and fixed this same thing while rebasing against
master a few minutes ago.  Thanks for pointing it out.
diff mbox

Patch

diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
index ed21455..e6bb43f 100644
--- a/utilities/ovs-vsctl.c
+++ b/utilities/ovs-vsctl.c
@@ -2291,8 +2291,8 @@  cmd_get_aa_mapping(struct ctl_context *ctx)

 ^L
 static const struct ctl_table_class tables[OVSREC_N_TABLES] = {
-    [OVSREC_TABLE_BRIDGE].row_ids[0] = {
-        {&ovsrec_table_bridge, &ovsrec_bridge_col_name, NULL}},
+    [OVSREC_TABLE_BRIDGE].row_ids[0]
+    = {&ovsrec_table_bridge, &ovsrec_bridge_col_name, NULL},

     [OVSREC_TABLE_CONTROLLER].row_ids[0]
     = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
@@ -2324,9 +2324,9 @@  static const struct ctl_table_class
tables[OVSREC_N_TABLES] = {
     [OVSREC_TABLE_FLOW_TABLE].row_ids[0]
     = {&ovsrec_table_flow_table, &ovsrec_flow_table_col_name, NULL},

-    [OVSREC_TABLE_IPFIX].row_ids[0] = {
-     {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
-      &ovsrec_bridge_col_ipfix}},
+    [OVSREC_TABLE_IPFIX].row_ids[0]
+    = {&ovsrec_table_bridge, &ovsrec_bridge_col_name,
+       &ovsrec_bridge_col_ipfix},

     [OVSREC_TABLE_AUTOATTACH].row_ids[0]