[Sheepdog] [PATCH v2 6/6] cluster: add check for cluster driver definition

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Oct 4 14:38:58 CEST 2011


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/cluster.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sheep/cluster.h b/sheep/cluster.h
index ce1074d..43f4575 100644
--- a/sheep/cluster.h
+++ b/sheep/cluster.h
@@ -97,6 +97,9 @@ extern struct list_head cluster_drivers;
 
 #define cdrv_register(driver)						\
 static void __attribute__((constructor)) regist_ ## driver(void) {	\
+	if (!driver.init || !driver.join || !driver.leave ||		\
+	    !driver.notify || !driver.dispatch)				\
+		panic("the driver '%s' is incomplete\n", driver.name);	\
 	list_add(&driver.list, &cluster_drivers);			\
 }
 
-- 
1.7.2.5




More information about the sheepdog mailing list