[ovs-dev] [PATCH 2/3] connmgr: Demote service controllers too in ofconn_set_role().

Justin Pettit jpettit at nicira.com
Fri Jul 25 23:59:21 UTC 2014


It might be nice to document that "controllers" only contains primary controllers.  The definitions don't provide any distinction between the various members:

    struct hmap controllers;   /* Controller "struct ofconn"s. */
    struct list all_conns;     /* Contains "struct ofconn"s. */

However, overall:

Acked-by: Justin Pettit <jpettit at nicira.com>

--Justin


On July 22, 2014 at 3:58:41 PM, Ben Pfaff (blp at nicira.com) wrote:
> Service controllers can set their roles, so it's necessary to demote them
> to slaves if another controller becomes master. Unfortunately the
> 'controllers' hmap only contains primary controllers, so this was omitted.
>  
> Signed-off-by: Ben Pfaff  
> ---
> ofproto/connmgr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>  
> diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
> index 80b0f6d..be99529 100644
> --- a/ofproto/connmgr.c
> +++ b/ofproto/connmgr.c
> @@ -932,7 +932,7 @@ ofconn_set_role(struct ofconn *ofconn, enum ofp12_controller_role  
> role)
> if (role != ofconn->role && role == OFPCR12_ROLE_MASTER) {
> struct ofconn *other;
>  
> - HMAP_FOR_EACH (other, hmap_node, &ofconn->connmgr->controllers) {
> + LIST_FOR_EACH (other, node, &ofconn->connmgr->all_conns) {
> if (other->role == OFPCR12_ROLE_MASTER) {
> other->role = OFPCR12_ROLE_SLAVE;
> ofconn_send_role_status(other, OFPCR12_ROLE_SLAVE, OFPCRR_MASTER_REQUEST);  
> --
> 1.7.10.4
>  
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>  




More information about the dev mailing list