On Dec 6, 2016 3:18 AM, "Ben Pfaff" <b...@ovn.org> wrote:

Hi Numan, is this still relevant?  It seems to have been overlooked,
since I can't find any followups on the mailing lists.  If it's still
worth merging, would you mind posting a rebased version?

Thanks, and sorry to have missed this!


Hi Ben,
No its not relevant as "ovsdb-server/sync-status" provides the same
information.

Thanks
Numan


Ben

On Fri, Aug 19, 2016 at 08:17:43PM +0530, Numan Siddique wrote:
> This command will be useful to query if the ovsdb-server
> instance is active or backup.
>
> Signed-off-by: Numan Siddique <nusid...@redhat.com>
> ---
>  ovsdb/ovsdb-server.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
> index e08c341..283ec1b 100644
> --- a/ovsdb/ovsdb-server.c
> +++ b/ovsdb/ovsdb-server.c
> @@ -81,6 +81,7 @@ static unixctl_cb_func ovsdb_server_set_active_ovsdb_
server;
>  static unixctl_cb_func ovsdb_server_get_active_ovsdb_server;
>  static unixctl_cb_func ovsdb_server_connect_active_ovsdb_server;
>  static unixctl_cb_func ovsdb_server_disconnect_active_ovsdb_server;
> +static unixctl_cb_func ovsdb_server_is_backup_server;
>  static unixctl_cb_func ovsdb_server_set_sync_excluded_tables;
>  static unixctl_cb_func ovsdb_server_get_sync_excluded_tables;
>
> @@ -361,6 +362,9 @@ main(int argc, char *argv[])
>      unixctl_command_register("ovsdb-server/disconnect-active-ovsdb-server",
"",
>                               0, 0, ovsdb_server_disconnect_
active_ovsdb_server,
>                               NULL);
> +    unixctl_command_register("ovsdb-server/is-backup-server", "",
> +                             0, 0, ovsdb_server_is_backup_server,
> +                             NULL);
>      unixctl_command_register("ovsdb-server/set-sync-excluded-tables", "",
>                               0, 1, ovsdb_server_set_sync_excluded_tables,
>                               NULL);
> @@ -1104,6 +1108,19 @@ ovsdb_server_disconnect_active_ovsdb_server(struct
unixctl_conn *conn,
>  }
>
>  static void
> +ovsdb_server_is_backup_server(struct unixctl_conn *conn,
> +                                         int argc OVS_UNUSED,
> +                                         const char *argv[] OVS_UNUSED,
> +                                         void *arg_ OVS_UNUSED)
> +{
> +    struct ds s;
> +    ds_init(&s);
> +    ds_put_format(&s, "%s\n", is_backup_server ? "true": "false");
> +    unixctl_command_reply(conn, ds_cstr(&s));
> +    ds_destroy(&s);
> +}
> +
> +static void
>  ovsdb_server_set_sync_excluded_tables(struct unixctl_conn *conn,
>                                        int argc OVS_UNUSED,
>                                        const char *argv[],
> --
> 2.7.4
>
> _______________________________________________
> dev mailing list
> d...@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to