[ovs-dev] [PATCH v3 1/2] ovn-controller: Warn if system-id ismissing.

Ryan Moats rmoats at us.ibm.com
Thu Apr 7 16:44:08 UTC 2016


"dev" <dev-bounces at openvswitch.org> wrote on 04/07/2016 10:39:32 AM:

> From: Russell Bryant <russell at ovn.org>
> To: dev at openvswitch.org
> Date: 04/07/2016 10:39 AM
> Subject: [ovs-dev] [PATCH v3 1/2] ovn-controller: Warn if system-id
> is missing.
> Sent by: "dev" <dev-bounces at openvswitch.org>
>
> If 'system-id' is missing from the Open_vSwitch database, ovn-controller
> will not work.  Log a warning if that happens to make it clear that
> configuration is incomplete.
>
> Signed-off-by: Russell Bryant <russell at ovn.org>
> ---
>  ovn/controller/ovn-controller.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> v3:
>  - This patch is new in v3, as suggested by Han Zhou.
>
> diff --git a/ovn/controller/ovn-controller.c
b/ovn/controller/ovn-controller.c
> index 6027011..31a9a39 100644
> --- a/ovn/controller/ovn-controller.c
> +++ b/ovn/controller/ovn-controller.c
> @@ -169,7 +169,14 @@ static const char *
>  get_chassis_id(const struct ovsdb_idl *ovs_idl)
>  {
>      const struct ovsrec_open_vswitch *cfg =
> ovsrec_open_vswitch_first(ovs_idl);
> -    return cfg ? smap_get(&cfg->external_ids, "system-id") : NULL;
> +    const char *chassis_id = cfg ? smap_get(&cfg->external_ids,
> "system-id") : NULL;
> +
> +    if (!chassis_id) {
> +        static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);
> +        VLOG_WARN_RL(&rl, "'system-id' in Open_vSwitch database is
> missing.");
> +    }
> +
> +    return chassis_id;
>  }
>
>  /* Retrieves the OVN Southbound remote location from the
> --
> 2.5.5

This looks sane and it doesn't break unit tests, so...

Acked-by: Ryan Moats <rmoats at us.ibm.com>




More information about the dev mailing list