On 20 Jan 2025, at 16:00, Roi Dayan wrote:

> ovs_get_program_version() already returns the formatted program name and
> version instead of doing it again.
>
> Signed-off-by: Roi Dayan <[email protected]>

One small issue below, but we should be able to apply those at commit time.
Did some tests with these change, and with the comment below folded in;

Acked-by: Eelco Chaudron <[email protected]>

> ---
>
> Notes:
>     v2
>     - Do the same for ovsdb-server.c and ovsdb-error.c.
>
>  lib/ovsdb-error.c    | 2 +-
>  ovsdb/ovsdb-server.c | 3 +--
>  vswitchd/bridge.c    | 3 +--
>  3 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/lib/ovsdb-error.c b/lib/ovsdb-error.c
> index 56512fc28dda..036897db0cd7 100644
> --- a/lib/ovsdb-error.c
> +++ b/lib/ovsdb-error.c
> @@ -146,7 +146,7 @@ ovsdb_internal_error(struct ovsdb_error *inner_error,
>          ds_put_char(&ds, ')');
>      }
>
> -    ds_put_format(&ds, " (%s %s)", program_name, VERSION VERSION_SUFFIX);
> +    ds_put_format(&ds, " %s", ovs_get_program_version());

We should keep the () here.

>
>      if (inner_error) {
>          char *s = ovsdb_error_to_string_free(inner_error);
> diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
> index fbc7ad5efe32..7fde858724b8 100644
> --- a/ovsdb/ovsdb-server.c
> +++ b/ovsdb/ovsdb-server.c
> @@ -817,8 +817,7 @@ main(int argc, char *argv[])
>          /* ovsdb-server is usually a long-running process, in which case it
>           * makes plenty of sense to log the version, but --run makes
>           * ovsdb-server more like a command-line tool, so skip it.  */
> -        VLOG_INFO("%s (Open vSwitch) %s", program_name,
> -                  VERSION VERSION_SUFFIX);
> +        VLOG_INFO("%s", ovs_get_program_version());
>      }
>
>      unixctl_command_register("exit", "", 0, 0, ovsdb_server_exit, &exiting);
> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index 509ea19ecc99..456b784c01d0 100644
> --- a/vswitchd/bridge.c
> +++ b/vswitchd/bridge.c
> @@ -3471,8 +3471,7 @@ bridge_run(void)
>
>              vlog_enable_async();
>
> -            VLOG_INFO_ONCE("%s (Open vSwitch) %s", program_name,
> -                           VERSION VERSION_SUFFIX);
> +            VLOG_INFO_ONCE("%s", ovs_get_program_version());
>          }
>      }
>
> -- 
> 2.21.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to