Przeglądaj źródła

Merge trunk revision 2684:
r2684 | chrissie | 2010-03-16 02:53:18 -0700 (Tue, 16 Mar 2010) | 6 lines

Fix a couple of small bugs that happen when the configuration is reloaded.

1. the reload callback was not sent to the library,
2. totem exponentially added new callbacks because the old ones were not
removed properly.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/branches/flatiron@2803 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 16 lat temu
rodzic
commit
750221093d
2 zmienionych plików z 14 dodań i 4 usunięć
  1. 2 1
      exec/objdb.c
  2. 12 3
      exec/totemconfig.c

+ 2 - 1
exec/objdb.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2006 MontaVista Software, Inc.
- * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Copyright (c) 2007-2010 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -352,6 +352,7 @@ static void object_reload_notification(int startstop, int flush)
 			if (tmptracker_pt) {
 				list_add(&tmptracker_pt->object_list, &tmplist);
 				tmptracker_pt->object_reload_notify_fn = tracker_pt->object_reload_notify_fn;
+				tmptracker_pt->data_pt = tracker_pt->data_pt;
 			}
 		}
 	}

+ 12 - 3
exec/totemconfig.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2002-2005 MontaVista Software, Inc.
- * Copyright (c) 2006-2009 Red Hat, Inc.
+ * Copyright (c) 2006-2010 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -818,6 +818,9 @@ static void totem_objdb_reload_notify(objdb_reload_notify_type_t type, int flush
 	struct totem_config *totem_config = priv_data_pt;
 	hdb_handle_t totem_object_handle;
 
+	if (totem_config == NULL)
+	        return;
+
 	/*
 	 * A new totem {} key might exist, cancel the
 	 * existing notification at the start of reload,
@@ -831,7 +834,7 @@ static void totem_objdb_reload_notify(objdb_reload_notify_type_t type, int flush
 			NULL,
 			NULL,
 			NULL,
-			NULL);
+			totem_config);
 	}
 
 	if (type == OBJDB_RELOAD_NOTIFY_END ||
@@ -840,8 +843,14 @@ static void totem_objdb_reload_notify(objdb_reload_notify_type_t type, int flush
 
 		if (!totem_handle_find(global_objdb,
 				      &totem_object_handle)) {
-			add_totem_config_notification(global_objdb, totem_config, totem_object_handle);
 
+		        global_objdb->object_track_start(totem_object_handle,
+						  1,
+						  totem_key_change_notify,
+						  NULL, // object_create_notify,
+						  NULL, // object_destroy_notify,
+						  NULL, // object_reload_notify
+						  totem_config); // priv_data
 			/*
 			 * Reload the configuration
 			 */