[ovs-dev] [PATCH 1/4] db-ctl-base: remove db_ctl_show_command table
Alex Wang
alexw at nicira.com
Thu Jul 16 16:23:47 UTC 2015
Thx for the cleanup,
I found myself wondering the same question,
Acked-by: Alex Wang <alexw at nicira.com>
On Mon, Jul 13, 2015 at 11:48 PM, Andy Zhou <azhou at nicira.com> wrote:
> It is not clear why "show" command needs its own command table.
> Remove it for simplicity.
>
> Signed-off-by: Andy Zhou <azhou at nicira.com>
> ---
> lib/db-ctl-base.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
> index 86a87d0..d38bf03 100644
> --- a/lib/db-ctl-base.c
> +++ b/lib/db-ctl-base.c
> @@ -1136,7 +1136,7 @@ cmd_set(struct ctl_context *ctx)
> bool must_exist = !shash_find(&ctx->options, "--if-exists");
> const char *table_name = ctx->argv[1];
> const char *record_id = ctx->argv[2];
> - const struct ctl_table_class*table;
> + const struct ctl_table_class *table;
> const struct ovsdb_idl_row *row;
> int i;
>
> @@ -1949,12 +1949,6 @@ ctl_exit(int status)
> exit(status);
> }
>
> -/* Command for showing overview of database contents. */
> -static const struct ctl_command_syntax db_ctl_show_command[] = {
> - {"show", 0, 0, "", pre_cmd_show, cmd_show, NULL, "", RO},
> - {NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, RO},
> -};
> -
> /* Comman database commands to be registered. */
> static const struct ctl_command_syntax db_ctl_commands[] = {
> {"comment", 0, INT_MAX, "[ARG]...", NULL, NULL, NULL, "", RO},
> @@ -1978,6 +1972,7 @@ static const struct ctl_command_syntax
> db_ctl_commands[] = {
> NULL, "--if-exists,--all", RW},
> {"wait-until", 2, INT_MAX, "TABLE RECORD [COLUMN[:KEY]=VALUE]...",
> pre_cmd_wait_until, cmd_wait_until, NULL, "", RO},
> + {"show", 0, 0, "", pre_cmd_show, cmd_show, NULL, "", RO},
> {NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, RO},
> };
>
> @@ -2000,7 +1995,6 @@ ctl_init(const struct ctl_table_class tables_[])
> {
> tables = tables_;
> ctl_register_commands(db_ctl_commands);
> - ctl_register_commands(db_ctl_show_command);
> }
>
> /* Returns 'all_commands'. */
> --
> 1.9.1
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
More information about the dev
mailing list