[PATCH] pload: make it a test service and not a public one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>

pload is a performance benchmark that measures the onwire
speed of corosync.

problem is that once pload has been executed, the cluster
is basically dead.

turn pload into a test tool, by removing corosync-pload tool
and user library.

cleanup pload code to make it more readable and drop lots
of unnecessary stuff.

add test/ploadstart tool that can configure and start pload
via cmap calls.

Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
---
 configure.ac                 |    1 -
 corosync.spec.in             |    4 -
 exec/coroparse.c             |   14 ++
 exec/pload.c                 |  343 ++++++++++++++++++++++--------------------
 exec/util.h                  |    3 +-
 include/Makefile.am          |    4 +-
 include/corosync/ipc_pload.h |   70 ---------
 include/corosync/pload.h     |  110 --------------
 lib/Makefile.am              |    5 +-
 lib/libpload.versions        |    6 -
 lib/libpload.verso           |    1 -
 lib/pload.c                  |  202 -------------------------
 man/Makefile.am              |    1 -
 man/corosync-pload.8         |   69 ---------
 man/index.html               |    4 -
 pkgconfig/Makefile.am        |    2 +-
 test/Makefile.am             |   10 +-
 test/ploadstart.sh           |   60 ++++++++
 tools/.gitignore             |    1 -
 tools/Makefile.am            |    5 +-
 tools/corosync-pload.c       |   79 ----------
 21 files changed, 270 insertions(+), 724 deletions(-)
 delete mode 100644 include/corosync/ipc_pload.h
 delete mode 100644 include/corosync/pload.h
 delete mode 100644 lib/libpload.versions
 delete mode 100644 lib/libpload.verso
 delete mode 100644 lib/pload.c
 delete mode 100644 man/corosync-pload.8
 create mode 100644 test/ploadstart.sh
 delete mode 100644 tools/corosync-pload.c

diff --git a/configure.ac b/configure.ac
index 9f22fce..721eb2d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -217,7 +217,6 @@ SONAME="${SOMAJOR}.${SOMINOR}.${SOMICRO}"
 LIB_SONAME_IMPORT([cfg])
 LIB_SONAME_IMPORT([cpg])
 LIB_SONAME_IMPORT([evs])
-LIB_SONAME_IMPORT([pload])
 LIB_SONAME_IMPORT([quorum])
 LIB_SONAME_IMPORT([sam])
 LIB_SONAME_IMPORT([votequorum])
diff --git a/corosync.spec.in b/corosync.spec.in
index b7e21a9..51fb7ad 100644
--- a/corosync.spec.in
+++ b/corosync.spec.in
@@ -151,7 +151,6 @@ fi
 %{_sbindir}/corosync-cmapctl
 %{_sbindir}/corosync-cfgtool
 %{_sbindir}/corosync-fplay
-%{_sbindir}/corosync-pload
 %{_sbindir}/corosync-cpgtool
 %{_sbindir}/corosync-quorumtool
 %{_sbindir}/corosync-notifyd
@@ -191,7 +190,6 @@ fi
 %{_mandir}/man8/corosync-cfgtool.8*
 %{_mandir}/man8/corosync-cpgtool.8*
 %{_mandir}/man8/corosync-fplay.8*
-%{_mandir}/man8/corosync-pload.8*
 %{_mandir}/man8/corosync-notifyd.8*
 %{_mandir}/man8/corosync-quorumtool.8*
 %{_mandir}/man5/corosync.conf.5*
@@ -241,7 +239,6 @@ This package contains corosync libraries.
 %{_libdir}/libtotem_pg.so.*
 %{_libdir}/libquorum.so.*
 %{_libdir}/libvotequorum.so.*
-%{_libdir}/libpload.so.*
 %{_libdir}/libsam.so.*
 %{_libdir}/libcorosync_common.so.*
 
@@ -286,7 +283,6 @@ The Corosync Cluster Engine APIs.
 %{_libdir}/libtotem_pg.so
 %{_libdir}/libquorum.so
 %{_libdir}/libvotequorum.so
-%{_libdir}/libpload.so
 %{_libdir}/libsam.so
 %{_libdir}/libcorosync_common.so
 %{_libdir}/pkgconfig/*.pc
diff --git a/exec/coroparse.c b/exec/coroparse.c
index c69a462..e9081ff 100644
--- a/exec/coroparse.c
+++ b/exec/coroparse.c
@@ -90,6 +90,7 @@ enum main_cp_cb_data_state {
 	MAIN_CP_CB_DATA_STATE_QDEVICE,
 	MAIN_CP_CB_DATA_STATE_NODELIST,
 	MAIN_CP_CB_DATA_STATE_NODELIST_NODE,
+	MAIN_CP_CB_DATA_STATE_PLOAD
 };
 
 struct key_value_list_item {
@@ -386,6 +387,16 @@ static int main_config_parser_cb(const char *path,
 		switch (data->state) {
 		case MAIN_CP_CB_DATA_STATE_NORMAL:
 			break;
+		case MAIN_CP_CB_DATA_STATE_PLOAD:
+			if ((strcmp(path, "pload.count") == 0) ||
+			    (strcmp(path, "pload.size") == 0)) {
+				if (safe_atoi(value, &i) != 0) {
+					goto atoi_error;
+				}
+				icmap_set_uint32(path, i);
+				add_as_string = 0;
+			}
+			break;
 		case MAIN_CP_CB_DATA_STATE_QUORUM:
 			if ((strcmp(path, "quorum.expected_votes") == 0) ||
 			    (strcmp(path, "quorum.votes") == 0) ||
@@ -696,6 +707,9 @@ static int main_config_parser_cb(const char *path,
 		switch (data->state) {
 		case MAIN_CP_CB_DATA_STATE_NORMAL:
 			break;
+		case MAIN_CP_CB_DATA_STATE_PLOAD:
+			data->state = MAIN_CP_CB_DATA_STATE_NORMAL;
+			break;
 		case MAIN_CP_CB_DATA_STATE_INTERFACE:
 			/*
 			 * Create new interface section
diff --git a/exec/pload.c b/exec/pload.c
index 8301477..a7d3e33 100644
--- a/exec/pload.c
+++ b/exec/pload.c
@@ -3,7 +3,8 @@
  *
  * All rights reserved.
  *
- * Author: Steven Dake (sdake@xxxxxxxxxx)
+ * Authors: Steven Dake (sdake@xxxxxxxxxx)
+ *          Fabio M. Di Nitto (fdinitto@xxxxxxxxxx)
  *
  * This software licensed under BSD license, the text of which follows:
  *
@@ -34,109 +35,53 @@
 
 #include <config.h>
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <netinet/in.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <time.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <assert.h>
-
 #include <qb/qblist.h>
 #include <qb/qbutil.h>
 #include <qb/qbipc_common.h>
 
 #include <corosync/swab.h>
-#include <corosync/corotypes.h>
 #include <corosync/corodefs.h>
-#include <corosync/mar_gen.h>
 #include <corosync/coroapi.h>
-#include <corosync/ipc_pload.h>
-#include <corosync/list.h>
+#include <corosync/icmap.h>
 #include <corosync/logsys.h>
 
 #include "service.h"
+#include "util.h"
 
 LOGSYS_DECLARE_SUBSYS ("PLOAD");
 
-enum pload_exec_message_req_types {
-	MESSAGE_REQ_EXEC_PLOAD_START = 0,
-	MESSAGE_REQ_EXEC_PLOAD_MCAST = 1
-};
-
 /*
  * Service Interfaces required by service_message_handler struct
  */
-static char *pload_exec_init_fn (struct corosync_api_v1 *corosync_api);
-
-static void pload_confchg_fn (
-	enum totem_configuration_type configuration_type,
-	const unsigned int *member_list, size_t member_list_entries,
-	const unsigned int *left_list, size_t left_list_entries,
-	const unsigned int *joined_list, size_t joined_list_entries,
-	const struct memb_ring_id *ring_id);
-
-static void message_handler_req_exec_pload_start (const void *msg,
-						  unsigned int nodeid);
-
-static void message_handler_req_exec_pload_mcast (const void *msg,
-						  unsigned int nodeid);
-
-static void req_exec_pload_start_endian_convert (void *msg);
-
-static void req_exec_pload_mcast_endian_convert (void *msg);
-
-static void message_handler_req_pload_start (void *conn, const void *msg);
-
-static int pload_lib_init_fn (void *conn);
-
-static int pload_lib_exit_fn (void *conn);
-
-static char buffer[1000000];
-
-static unsigned int msgs_delivered = 0;
-
-static unsigned int msgs_wanted = 0;
-
-static unsigned int msg_size = 0;
-
-static unsigned int msg_code = 1;
-
-static unsigned int msgs_sent = 0;
+static struct corosync_api_v1 *api;
 
+static char *pload_exec_init_fn (struct corosync_api_v1 *corosync_api);
 
-static struct corosync_api_v1 *api;
+/*
+ * on wire / network bits
+ */
+enum pload_exec_message_req_types {
+	MESSAGE_REQ_EXEC_PLOAD_START = 0,
+	MESSAGE_REQ_EXEC_PLOAD_MCAST = 1
+};
 
 struct req_exec_pload_start {
 	struct qb_ipc_request_header header;
-	unsigned int msg_code;
-	unsigned int msg_count;
-	unsigned int msg_size;
-	unsigned int time_interval;
+	uint32_t msg_count;
+	uint32_t msg_size;
 };
 
 struct req_exec_pload_mcast {
 	struct qb_ipc_request_header header;
-	unsigned int msg_code;
 };
 
-static struct corosync_lib_handler pload_lib_engine[] =
-{
-	{ /* 0 */
-		.lib_handler_fn		= message_handler_req_pload_start,
-		.flow_control		= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
-	}
-};
+static void message_handler_req_exec_pload_start (const void *msg,
+						  unsigned int nodeid);
+static void req_exec_pload_start_endian_convert (void *msg);
+
+static void message_handler_req_exec_pload_mcast (const void *msg,
+						  unsigned int nodeid);
+static void req_exec_pload_mcast_endian_convert (void *msg);
 
 static struct corosync_exec_handler pload_exec_engine[] =
 {
@@ -150,100 +95,108 @@ static struct corosync_exec_handler pload_exec_engine[] =
 	}
 };
 
+/*
+ * internal bits and pieces
+ */
+
+/*
+ * really unused buffer but we need to give something to iovec
+ */
+static char buffer[1000000];
+
+/*
+ * wanted/size come from config
+ * sent/delivered track the runtime status
+ */
+static uint32_t msgs_wanted = 0;
+static uint32_t msg_size = 0;
+static uint32_t msgs_sent = 0;
+static uint32_t msgs_delivered = 0;
+
+/*
+ * bit flip to track if we are running or not and avoid multiple instances
+ */
+static uint8_t pload_started = 0;
+
+/*
+ * handle for scheduler
+ */
+static hdb_handle_t start_mcasting_handle;
+
+/*
+ * timing/profiling
+ */
+static unsigned long long int tv1;
+static unsigned long long int tv2;
+static unsigned long long int tv_elapsed;
+
+/*
+ * Service engine hooks
+ */
 struct corosync_service_engine pload_service_engine = {
 	.name			= "corosync profile loading service",
 	.id			= PLOAD_SERVICE,
 	.priority		= 1,
-	.private_data_size	= 0,
 	.flow_control		= CS_LIB_FLOW_CONTROL_REQUIRED,
-	.lib_init_fn		= pload_lib_init_fn,
-	.lib_exit_fn		= pload_lib_exit_fn,
-	.lib_engine		= pload_lib_engine,
-	.lib_engine_count	= sizeof (pload_lib_engine) / sizeof (struct corosync_lib_handler),
 	.exec_engine		= pload_exec_engine,
 	.exec_engine_count	= sizeof (pload_exec_engine) / sizeof (struct corosync_exec_handler),
-	.confchg_fn		= pload_confchg_fn,
-	.exec_init_fn		= pload_exec_init_fn,
-	.exec_dump_fn		= NULL
+	.exec_init_fn		= pload_exec_init_fn
 };
 
-static DECLARE_LIST_INIT (confchg_notify);
-
 struct corosync_service_engine *pload_get_service_engine_ver0 (void)
 {
 	return (&pload_service_engine);
 }
 
-static char *pload_exec_init_fn (struct corosync_api_v1 *corosync_api)
-{
-#ifdef COROSYNC_SOLARIS
-	logsys_subsys_init();
-#endif
-	api = corosync_api;
-
-	return NULL;
-}
-
-static void pload_confchg_fn (
-	enum totem_configuration_type configuration_type,
-	const unsigned int *member_list, size_t member_list_entries,
-	const unsigned int *left_list, size_t left_list_entries,
-	const unsigned int *joined_list, size_t joined_list_entries,
-	const struct memb_ring_id *ring_id)
-{
-}
+/*
+ * internal use only functions
+ */
 
-static int pload_lib_init_fn (void *conn)
-{
-	return (0);
-}
+/*
+ * not all architectures / OSes define timersub in sys/time.h or time.h
+ */
 
-static int pload_lib_exit_fn (void *conn)
-{
-	return (0);
-}
+#ifndef timersub
+#warning Using internal timersub definition. Check your include header files
+#define timersub(a, b, result)					\
+do {								\
+	(result)->tv_sec = (a)->tv_sec - (b)->tv_sec;		\
+	(result)->tv_usec = (a)->tv_usec - (b)->tv_usec;	\
+	if ((result)->tv_usec < 0) {				\
+		--(result)->tv_sec;				\
+		(result)->tv_usec += 1000000;			\
+	}							\
+} while (0)
+#endif /* timersub */
 
-static void message_handler_req_pload_start (void *conn, const void *msg)
+/*
+ * tell all cluster nodes to start mcasting
+ */
+static void pload_send_start (uint32_t count, uint32_t size)
 {
-	const struct req_lib_pload_start *req_lib_pload_start = msg;
 	struct req_exec_pload_start req_exec_pload_start;
 	struct iovec iov;
 
-	req_exec_pload_start.header.id =
-		SERVICE_ID_MAKE (PLOAD_SERVICE, MESSAGE_REQ_EXEC_PLOAD_START);
-	req_exec_pload_start.msg_code = req_lib_pload_start->msg_code;
-	req_exec_pload_start.msg_size = req_lib_pload_start->msg_size;
-	req_exec_pload_start.msg_count = req_lib_pload_start->msg_count;
-	req_exec_pload_start.time_interval = req_lib_pload_start->time_interval;
+	req_exec_pload_start.header.id = SERVICE_ID_MAKE (PLOAD_SERVICE, MESSAGE_REQ_EXEC_PLOAD_START);
+	req_exec_pload_start.msg_count = count;
+	req_exec_pload_start.msg_size = size;
 	iov.iov_base = (void *)&req_exec_pload_start;
 	iov.iov_len = sizeof (struct req_exec_pload_start);
 
-	msgs_delivered = 0;
-
-	msgs_wanted = 0;
-
-	msgs_sent = 0;
-
 	api->totem_mcast (&iov, 1, TOTEM_AGREED);
 }
 
-static void req_exec_pload_start_endian_convert (void *msg)
-{
-}
-
-static void req_exec_pload_mcast_endian_convert (void *msg)
-{
-}
-
-static int send_message (const void *arg)
+/*
+ * send N empty data messages of size X
+ */
+static int pload_send_message (const void *arg)
 {
 	struct req_exec_pload_mcast req_exec_pload_mcast;
 	struct iovec iov[2];
 	unsigned int res;
 	unsigned int iov_len = 1;
 
-	req_exec_pload_mcast.header.id =
-		SERVICE_ID_MAKE (PLOAD_SERVICE, MESSAGE_REQ_EXEC_PLOAD_MCAST);
+	req_exec_pload_mcast.header.id = SERVICE_ID_MAKE (PLOAD_SERVICE, MESSAGE_REQ_EXEC_PLOAD_MCAST);
 	req_exec_pload_mcast.header.size = sizeof (struct req_exec_pload_mcast) + msg_size;
 
 	iov[0].iov_base = (void *)&req_exec_pload_mcast;
@@ -260,9 +213,9 @@ static int send_message (const void *arg)
 			break;
 		} else {
 			msgs_sent++;
-			msg_code++;
 		}
 	} while (msgs_sent < msgs_wanted);
+
 	if (msgs_sent == msgs_wanted) {
 		return (0);
 	} else {
@@ -270,14 +223,77 @@ static int send_message (const void *arg)
 	}
 }
 
-hdb_handle_t start_mcasting_handle;
+/*
+ * hook into icmap to read config at runtime
+ * we do NOT start by default, ever!
+ */
+static void pload_read_config(
+	int32_t event,
+	const char *key_name,
+	struct icmap_notify_value new_val,
+	struct icmap_notify_value old_val,
+	void *user_data)
+{
+	uint32_t pload_count = 1500000;
+	uint32_t pload_size = 300;
+	char *pload_start = NULL;
+
+	icmap_get_uint32("pload.count", &pload_count);
+	icmap_get_uint32("pload.size", &pload_size);
+
+	if (pload_size >= sizeof(buffer)) {
+		pload_size = sizeof(buffer);
+		log_printf(LOGSYS_LEVEL_WARNING, "pload size limited to %u", pload_size);
+	}
+
+	if ((!pload_started) &&
+	    (icmap_get_string("pload.start", &pload_start) == CS_OK)) {
+		if (!strcmp(pload_start,
+			    "i_totally_understand_pload_will_crash_my_cluster_and_kill_corosync_on_exit")) {
+			log_printf(LOGSYS_LEVEL_WARNING, "Starting pload!");
+			pload_send_start(pload_count,  pload_size);
+		}
+		free(pload_start);
+	}
+}
 
-static void start_mcasting (void)
+/*
+ * exec functions
+ */
+static char *pload_exec_init_fn (struct corosync_api_v1 *corosync_api)
 {
-	api->schedwrk_create (
-		&start_mcasting_handle,
-		send_message,
-		&start_mcasting_handle);
+	icmap_track_t pload_track = NULL;
+
+#ifdef COROSYNC_SOLARIS
+	logsys_subsys_init();
+#endif
+
+	api = corosync_api;
+
+	/*
+	 * track changes to pload config and start only on demand
+	 */
+	if (icmap_track_add("pload.",
+		ICMAP_TRACK_ADD | ICMAP_TRACK_DELETE | ICMAP_TRACK_MODIFY | ICMAP_TRACK_PREFIX,
+		pload_read_config,
+		NULL,
+		&pload_track) != CS_OK) {
+		return (char *)"Unable to setup pload config tracking!\n";
+	}
+
+	return NULL;
+}
+
+/*
+ * network messages/onwire handlers
+ */
+
+static void req_exec_pload_start_endian_convert (void *msg)
+{
+	struct req_exec_pload_start *req_exec_pload_start = msg;
+
+	req_exec_pload_start->msg_count = swab32(req_exec_pload_start->msg_count);
+	req_exec_pload_start->msg_size = swab32(req_exec_pload_start->msg_size);
 }
 
 static void message_handler_req_exec_pload_start (
@@ -286,37 +302,34 @@ static void message_handler_req_exec_pload_start (
 {
 	const struct req_exec_pload_start *req_exec_pload_start = msg;
 
+	/*
+	 * don't start multiple instances
+	 */
+	if (pload_started) {
+		return;
+	}
+
+	pload_started = 1;
+
 	msgs_wanted = req_exec_pload_start->msg_count;
 	msg_size = req_exec_pload_start->msg_size;
-	msg_code = req_exec_pload_start->msg_code;
 
-	start_mcasting ();
+	api->schedwrk_create (
+		&start_mcasting_handle,
+		pload_send_message,
+		&start_mcasting_handle);
 }
-#ifndef timersub
-#define timersub(a, b, result)					\
-do {								\
-	(result)->tv_sec = (a)->tv_sec - (b)->tv_sec;		\
-	(result)->tv_usec = (a)->tv_usec - (b)->tv_usec;	\
-	if ((result)->tv_usec < 0) {				\
-		--(result)->tv_sec;				\
-		(result)->tv_usec += 1000000;			\
-	}							\
-} while (0)
-#endif /* timersub */
 
-unsigned long long int tv1;
-unsigned long long int tv2;
-unsigned long long int tv_elapsed;
-int last_msg_no = 0;
+static void req_exec_pload_mcast_endian_convert (void *msg)
+{
+}
 
 static void message_handler_req_exec_pload_mcast (
 	const void *msg,
 	unsigned int nodeid)
 {
-	const struct req_exec_pload_mcast *pload_mcast = msg;
 	char log_buffer[1024];
 
-	last_msg_no = pload_mcast->msg_code;
 	if (msgs_delivered == 0) {
 		tv1 = qb_util_nano_current_get ();
 	}
@@ -332,5 +345,7 @@ static void message_handler_req_exec_pload_mcast (
 			(((float)msgs_delivered) * ((float)msg_size) /
 				(tv_elapsed / 1000000000.0)) / (1024.0 * 1024.0));
 		log_printf (LOGSYS_LEVEL_NOTICE, "%s", log_buffer);
+		log_printf (LOGSYS_LEVEL_WARNING, "Stopping corosync the hard way");
+		exit(COROSYNC_DONE_PLOAD);
 	}
 }
diff --git a/exec/util.h b/exec/util.h
index a6e3593..faf038f 100644
--- a/exec/util.h
+++ b/exec/util.h
@@ -56,7 +56,8 @@ enum e_corosync_done {
 	COROSYNC_DONE_AQUIRE_LOCK = 17,
 	COROSYNC_DONE_ALREADY_RUNNING = 18,
 	COROSYNC_DONE_STD_TO_NULL_REDIR = 19,
-	COROSYNC_DONE_SERVICE_ENGINE_INIT = 20
+	COROSYNC_DONE_SERVICE_ENGINE_INIT = 20,
+	COROSYNC_DONE_PLOAD = 99
 };
 
 
diff --git a/include/Makefile.am b/include/Makefile.am
index ccd594f..e15d36c 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -34,8 +34,8 @@ MAINTAINERCLEANFILES    = Makefile.in corosync/config.h.in
 CS_H			= hdb.h cpg.h cfg.h evs.h corodefs.h \
 			corotypes.h quorum.h votequorum.h sam.h cmap.h
 
-CS_INTERNAL_H		= ipc_cfg.h ipc_cpg.h ipc_evs.h ipc_pload.h ipc_quorum.h 	\
-			pload.h quorum.h sq.h ipc_votequorum.h ipc_cmap.h \
+CS_INTERNAL_H		= ipc_cfg.h ipc_cpg.h ipc_evs.h ipc_quorum.h 	\
+			quorum.h sq.h ipc_votequorum.h ipc_cmap.h \
 			logsys.h coroapi.h icmap.h mar_gen.h list.h swab.h cs_config.h
 
 TOTEM_H			= totem.h totemip.h totempg.h
diff --git a/include/corosync/ipc_pload.h b/include/corosync/ipc_pload.h
deleted file mode 100644
index e815584..0000000
--- a/include/corosync/ipc_pload.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2008-2011 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Steven Dake (sdake@xxxxxxxxxx)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the MontaVista Software, Inc. nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef IPC_PLOAD_H_DEFINED
-#define IPC_PLOAD_H_DEFINED
-
-#include <corosync/corotypes.h>
-#include <corosync/mar_gen.h>
-
-enum req_lib_evs_types {
-	MESSAGE_REQ_PLOAD_START = 0,
-};
-
-enum res_lib_evs_types {
-	MESSAGE_RES_PLOAD_START = 0,
-};
-
-struct res_lib_pload_start {
-	struct qb_ipc_response_header header;
-	unsigned int dataset[1024];
-};
-
-struct res_lib_pload_mcast {
-	struct qb_ipc_response_header header;
-};
-
-struct req_lib_pload_start {
-	struct qb_ipc_request_header header;
-	unsigned int msg_code;
-	unsigned int msg_size;
-	unsigned int msg_count;
-	unsigned int time_interval;
-};
-
-struct req_lib_pload_mcast {
-	struct qb_ipc_request_header header;
-	unsigned int code;
-};
-
-#endif /* IPC_PLOAD_H_DEFINED */
diff --git a/include/corosync/pload.h b/include/corosync/pload.h
deleted file mode 100644
index 8109d8c..0000000
--- a/include/corosync/pload.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2008-2011 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Steven Dake (sdake@xxxxxxxxxx)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the MontaVista Software, Inc. nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef COROSYNC_PLOAD_H_DEFINED
-#define COROSYNC_PLOAD_H_DEFINED
-
-#include <sys/types.h>
-#include <netinet/in.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @defgroup corosync Other API services provided by corosync
- */
-/**
- * @addtogroup pload_corosync
- *
- * @{
- */
-
-typedef uint64_t pload_handle_t;
-
-typedef enum {
-	PLOAD_OK = 1,
-	PLOAD_ERR_LIBRARY = 2,
-	PLOAD_ERR_TIMEOUT = 5,
-	PLOAD_ERR_TRY_AGAIN = 6,
-	PLOAD_ERR_INVALID_PARAM = 7,
-	PLOAD_ERR_NO_MEMORY = 8,
-	PLOAD_ERR_BAD_HANDLE = 9,
-	PLOAD_ERR_ACCESS = 11,
-	PLOAD_ERR_NOT_EXIST = 12,
-	PLOAD_ERR_EXIST = 14,
-	PLOAD_ERR_NOT_SUPPORTED = 20,
-	PLOAD_ERR_SECURITY = 29,
-	PLOAD_ERR_TOO_MANY_GROUPS=30
-} pload_error_t;
-
-typedef struct {
-	int callback;
-} pload_callbacks_t;
-
-/** @} */
-
-/**
- * Create a new pload connection
- */
-pload_error_t pload_initialize (
-	pload_handle_t *handle,
-	pload_callbacks_t *callbacks);
-
-/**
- * Close the pload handle
- */
-pload_error_t pload_finalize (
-	pload_handle_t handle);
-
-/**
- * Get a file descriptor on which to poll.
- *
- * @note pload_handle_t is NOT a file descriptor and may not be used directly.
- */
-pload_error_t pload_fd_get (
-	pload_handle_t handle,
-	int *fd);
-
-unsigned int pload_start (
-        pload_handle_t handle,
-        unsigned int code,
-        unsigned int msg_count,
-        unsigned int msg_size);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* COROSYNC_PLOAD_H_DEFINED */
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6ded330..58c7b78 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -47,13 +47,12 @@ AM_LDFLAGS		= -lpthread -L../common_lib -lcorosync_common
 INCLUDES		= -I$(top_builddir)/include -I$(top_srcdir)/include
 
 lib_LIBRARIES		= libcpg.a libquorum.a libevs.a libcfg.a \
-			  libvotequorum.a libpload.a libsam.a libcmap.a
+			  libvotequorum.a libsam.a libcmap.a
 SHARED_LIBS_SO		= $(lib_LIBRARIES:%.a=%.so)
 
 libcpg_a_SOURCES	= cpg.c
 libcfg_a_SOURCES	= cfg.c
 libevs_a_SOURCES	= evs.c
-libpload_a_SOURCES	= pload.c
 libquorum_a_SOURCES	= quorum.c
 libvotequorum_a_SOURCES	= votequorum.c
 libcmap_a_SOURCES	= cmap.c
@@ -63,7 +62,7 @@ libsam_a_SOURCES	= sam.c
 noinst_HEADERS		= util.h \
 			  libcfg.versions \
 			  libcpg.versions \
-			  libevs.versions libpload.versions \
+			  libevs.versions \
 			  libquorum.versions libvotequorum.versions \
 			  libsam.versions libcmap.versions
 
diff --git a/lib/libpload.versions b/lib/libpload.versions
deleted file mode 100644
index b5cf01a..0000000
--- a/lib/libpload.versions
+++ /dev/null
@@ -1,6 +0,0 @@
-# Version and symbol export for libSaClm.so
-
-COROSYNC_PLOAD_1.0 {
-	global:
-		pload_start;
-};
diff --git a/lib/libpload.verso b/lib/libpload.verso
deleted file mode 100644
index fcdb2e1..0000000
--- a/lib/libpload.verso
+++ /dev/null
@@ -1 +0,0 @@
-4.0.0
diff --git a/lib/pload.c b/lib/pload.c
deleted file mode 100644
index 6cb5f44..0000000
--- a/lib/pload.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (c) 2008-2012 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Steven Dake (sdake@xxxxxxxxxx)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the MontaVista Software, Inc. nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <errno.h>
-
-#include <qb/qbipcc.h>
-
-#include <corosync/corotypes.h>
-#include <corosync/corodefs.h>
-#include <corosync/hdb.h>
-
-#include <corosync/pload.h>
-#include <corosync/ipc_pload.h>
-
-#include "util.h"
-
-struct pload_inst {
-	qb_ipcc_connection_t *c;
-	unsigned int finalize;
-};
-
-DECLARE_HDB_DATABASE(pload_handle_t_db,NULL);
-
-/**
- * @defgroup pload_corosync The extended virtual synchrony passthrough API
- * @ingroup corosync
- *
- * @{
- */
-/**
- * test
- * @param handle The handle of pload initialize
- * @param callbacks The callbacks for pload_initialize
- * @returns PLOAD_OK
- */
-unsigned int pload_initialize (
-	pload_handle_t *handle,
-	pload_callbacks_t *callbacks)
-{
-	cs_error_t error;
-	struct pload_inst *pload_inst;
-
-	error = hdb_error_to_cs(hdb_handle_create (&pload_handle_t_db, sizeof (struct pload_inst), handle));
-	if (error != CS_OK) {
-		goto error_no_destroy;
-	}
-
-	error = hdb_error_to_cs(hdb_handle_get (&pload_handle_t_db, *handle, (void *)&pload_inst));
-	if (error != CS_OK) {
-		goto error_destroy;
-	}
-
-	pload_inst->c = qb_ipcc_connect ("pload", IPC_REQUEST_SIZE);
-	if (pload_inst->c == NULL) {
-		error = qb_to_cs_error(-errno);
-		goto error_put_destroy;
-	}
-
-	(void)hdb_handle_put (&pload_handle_t_db, *handle);
-
-	return (CS_OK);
-
-error_put_destroy:
-	(void)hdb_handle_put (&pload_handle_t_db, *handle);
-error_destroy:
-	(void)hdb_handle_destroy (&pload_handle_t_db, *handle);
-error_no_destroy:
-	return (error);
-}
-
-unsigned int pload_finalize (
-	pload_handle_t handle)
-{
-	struct pload_inst *pload_inst;
-	cs_error_t error;
-
-	error = hdb_error_to_cs (hdb_handle_get (&pload_handle_t_db, handle, (void *)&pload_inst));
-	if (error != CS_OK) {
-		return (error);
-	}
-
-	/*
-	 * Another thread has already started finalizing
-	 */
-	if (pload_inst->finalize) {
-		(void)hdb_handle_put (&pload_handle_t_db, handle);
-		return (PLOAD_ERR_BAD_HANDLE);
-	}
-
-	pload_inst->finalize = 1;
-
-	qb_ipcc_disconnect(pload_inst->c);
-
-	(void)hdb_handle_destroy (&pload_handle_t_db, handle);
-
-	(void)hdb_handle_put (&pload_handle_t_db, handle);
-
-	return (PLOAD_OK);
-}
-
-unsigned int pload_fd_get (
-	pload_handle_t handle,
-	int *fd)
-{
-	cs_error_t error;
-	struct pload_inst *pload_inst;
-
-	error = hdb_error_to_cs(hdb_handle_get (&pload_handle_t_db, handle, (void *)&pload_inst));
-	if (error != CS_OK) {
-		return (error);
-	}
-
-	qb_ipcc_fd_get (pload_inst->c, fd);
-
-	(void)hdb_handle_put (&pload_handle_t_db, handle);
-
-	return (CS_OK);
-}
-
-unsigned int pload_start (
-	pload_handle_t handle,
-	unsigned int code,
-	unsigned int msg_count,
-	unsigned int msg_size)
-{
-	unsigned int error;
-	struct pload_inst *pload_inst;
-	struct iovec iov;
-	struct req_lib_pload_start req_lib_pload_start;
-	struct res_lib_pload_start res_lib_pload_start;
-
-	error = hdb_error_to_cs(hdb_handle_get (&pload_handle_t_db, handle, (void *)&pload_inst));
-	if (error != CS_OK) {
-		return (error);
-	}
-
-	req_lib_pload_start.header.size = sizeof (struct req_lib_pload_start);
-	req_lib_pload_start.header.id = MESSAGE_REQ_PLOAD_START;
-	req_lib_pload_start.msg_code = code;
-	req_lib_pload_start.msg_count = msg_count;
-	req_lib_pload_start.msg_size = msg_size;
-
-	iov.iov_base = (char *)&req_lib_pload_start;
-	iov.iov_len = sizeof (struct req_lib_pload_start);
-
-	error = qb_to_cs_error(qb_ipcc_sendv_recv(pload_inst->c,
-		&iov,
-		1,
-		&res_lib_pload_start,
-		sizeof (struct res_lib_pload_start), CS_IPC_TIMEOUT_MS));
-
-	if (error != CS_OK) {
-		goto error_exit;
-	}
-
-	error = res_lib_pload_start.header.error;
-
-error_exit:
-	(void)hdb_handle_put (&pload_handle_t_db, handle);
-
-	return (error);
-}
-
-/** @} */
diff --git a/man/Makefile.am b/man/Makefile.am
index 69c536c..54b1e19 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -135,7 +135,6 @@ dist_man_MANS 		= corosync.conf.5 \
 			  corosync-cfgtool.8 \
 			  corosync-cpgtool.8 \
 			  corosync-fplay.8 \
-			  corosync-pload.8 \
 			  corosync-notifyd.8 \
 			  corosync-quorumtool.8 \
 			  corosync_overview.8 \
diff --git a/man/corosync-pload.8 b/man/corosync-pload.8
deleted file mode 100644
index b04fff4..0000000
--- a/man/corosync-pload.8
+++ /dev/null
@@ -1,69 +0,0 @@
-.\"/*
-.\" * Copyright (C) 2010 Red Hat, Inc.
-.\" *
-.\" * All rights reserved.
-.\" *
-.\" * Author: Angus Salkeld <asalkeld@xxxxxxxxxx>
-.\" *
-.\" * This software licensed under BSD license, the text of which follows:
-.\" *
-.\" * Redistribution and use in source and binary forms, with or without
-.\" * modification, are permitted provided that the following conditions are met:
-.\" *
-.\" * - Redistributions of source code must retain the above copyright notice,
-.\" *   this list of conditions and the following disclaimer.
-.\" * - Redistributions in binary form must reproduce the above copyright notice,
-.\" *   this list of conditions and the following disclaimer in the documentation
-.\" *   and/or other materials provided with the distribution.
-.\" * - Neither the name of the MontaVista Software, Inc. nor the names of its
-.\" *   contributors may be used to endorse or promote products derived from this
-.\" *   software without specific prior written permission.
-.\" *
-.\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-.\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-.\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-.\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-.\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-.\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-.\" * THE POSSIBILITY OF SUCH DAMAGE.
-.\" */
-.TH COROSYNC-PLOAD 8 2010-05-30
-.SH NAME
-corosync-pload \- Start payload test.
-.SH SYNOPSIS
-.B "corosync-pload"
-.SH DESCRIPTION
-.B corosync-pload
-starts the pload service.
-This is used as a test tool to generate traffic.
-All nodes will begin transmitting messages and they will stop when
-1500000 messages have been received per node.
-.PP
-To view the progress of this execute:
-.PP
-$ corosync-cmapctl runtime.services.pload.
-.br
-runtime.services.pload.service_id=13
-.br
-runtime.services.pload.0.tx=3
-.br
-runtime.services.pload.0.rx=2
-.br
-runtime.services.pload.1.tx=2478788
-.br
-runtime.services.pload.1.rx=4467870
-.PP
-At the end of the run a log message will be written showing the number of messages written
-and the time that this took.
-.PP
-corosync[4931]: [PLOAD ] 1500000 Writes 300 bytes per write  30.838 seconds runtime, 48640.968 TP/S, 13.916 MB/S.
-.TP
-.SH SEE ALSO
-.BR corosync-cmapctl (8)
-.SH AUTHOR
-Angus Salkeld
-.PP
diff --git a/man/index.html b/man/index.html
index b067b71..793d511 100644
--- a/man/index.html
+++ b/man/index.html
@@ -67,10 +67,6 @@
       Description of corosync-cmapctl tool.
       <br>
 
-      <a href="corosync-pload.8.html">corosync-pload(8)</a>:
-      Description of corosync-pload tool.
-      <br>
-
       <a href="corosync-quorumtool.8.html">corosync-quorumtool(8)</a>:
       Description of corosync-quorumtool tool.
       <br>
diff --git a/pkgconfig/Makefile.am b/pkgconfig/Makefile.am
index 50691ba..ac2f974 100644
--- a/pkgconfig/Makefile.am
+++ b/pkgconfig/Makefile.am
@@ -32,7 +32,7 @@ MAINTAINERCLEANFILES	= Makefile.in
 
 EXTRA_DIST		= libtemplate.pc.in corosync.pc.in
 
-LIBS	= cfg cpg evs pload quorum \
+LIBS	= cfg cpg evs quorum \
 	  totem_pg votequorum sam cmap corosync_common
 
 target_LIBS = $(LIBS:%=lib%.pc)
diff --git a/test/Makefile.am b/test/Makefile.am
index af19ab2..647aad2 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -33,11 +33,15 @@
 MAINTAINERCLEANFILES    = Makefile.in
 INCLUDES       		= -I$(top_builddir)/include/corosync -I$(top_srcdir)/include
 
+EXTRA_DIST		= ploadstart.sh
+
 noinst_PROGRAMS		= testevs evsbench evsverify cpgverify testcpg testcpg2 cpgbench \
 			  testquorum testvotequorum1 testvotequorum2	\
 			  stress_cpgfdget stress_cpgcontext cpgbound testsam \
 			  testcpgzc cpgbenchzc testzcgc stress_cpgzc
 
+noinst_SCRIPTS		= ploadstart
+
 COMMON_OPTS		= -L../lib -L../common_lib -Wl,-rpath,../common_lib
 
 testevs_LDADD		= -levs $(LIBQB_LIBS)
@@ -77,6 +81,10 @@ cpgbenchzc_LDFLAGS	= $(COMMON_OPTS)
 testsam_LDADD		= -lsam -lcmap -lquorum $(LIBQB_LIBS)
 testsam_LDFLAGS		= $(COMMON_OPTS)
 
+ploadstart: ploadstart.sh
+	cp $^ $@
+	chmod 755 $@
+
 LINT_FILES1:=$(filter-out sa_error.c, $(wildcard *.c))
 LINT_FILES2:=$(filter-out testevsth.c, $(LINT_FILES1))
 LINT_FILES:=$(filter-out testparse.c, $(LINT_FILES2))
@@ -85,4 +93,4 @@ lint:
 	-for f in $(LINT_FILES) ; do echo Splint $$f ; splint $(INCLUDES) $(LINT_FLAGS) $(CFLAGS) $$f ; done
 
 clean-local:
-	rm -f fdata
+	rm -f fdata ploadstart
diff --git a/test/ploadstart.sh b/test/ploadstart.sh
new file mode 100644
index 0000000..24063f7
--- /dev/null
+++ b/test/ploadstart.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+set -e
+
+msg_count=""
+msg_size=""
+
+usage() {
+	echo "ploadstart [options]"
+	echo ""
+	echo "Options:"
+	echo " -c msg_count    Number of messages to send (max UINT32_T default 1500000)"
+	echo " -s msg_size     Size of messages in bytes  (max 1000000  default 300)"
+	echo " -h              display this help"
+}
+
+while getopts "hs:c:" optflag; do
+		case "$optflag" in
+		h)
+			usage
+			exit 0
+		;;
+		c)
+			msg_count="$OPTARG"
+		;;
+		s)
+			msg_size="$OPTARG"
+		;;
+		\?|:)
+			usage
+			exit 1
+		;;
+		esac
+done
+
+[ -n "$msg_count" ] && corosync-cmapctl -s pload.count u32 $msg_count
+[ -n "$msg_size" ] && corosync-cmapctl -s pload.count u32 $msg_size
+
+echo "***** WARNING *****"
+echo ""
+echo "Running pload test will kill your cluster and all corosync daemons will exit"
+echo "at the end of the load test"
+echo ""
+echo "***** END OF WARNING *****"
+echo ""
+echo "YOU HAVE BEEN WARNED"
+echo ""
+echo "If you agree, and want to proceed, please type:"
+echo "Yes, I fully understand the risks of what I am doing"
+echo ""
+read -p "type here: " ans
+
+[ "$ans" = "Yes, I fully understand the risks of what I am doing" ] || {
+	echo "Wise choice.. or you simply didn't type it right"
+	exit 0
+}
+
+corosync-cmapctl -s pload.start str i_totally_understand_pload_will_crash_my_cluster_and_kill_corosync_on_exit
+
+echo "PLOAD started, please see corosync.log for final results"
diff --git a/tools/.gitignore b/tools/.gitignore
index 2d9fa0f..c63290e 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -2,7 +2,6 @@ corosync-cfgtool
 corosync-cpgtool
 corosync-fplay
 corosync-keygen
-corosync-pload
 corosync-quorumtool
 corosync-notifyd
 corosync-cmapctl
diff --git a/tools/Makefile.am b/tools/Makefile.am
index ed24725..5cd738b 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -35,7 +35,7 @@ INCLUDES       		= -I$(top_builddir)/include  -I$(top_srcdir)/include \
 
 sbin_PROGRAMS		= corosync-fplay corosync-cfgtool \
 			  corosync-keygen \
-			  corosync-pload corosync-cpgtool corosync-quorumtool \
+			  corosync-cpgtool corosync-quorumtool \
 			  corosync-notifyd corosync-cmapctl
 
 bin_SCRIPTS		= corosync-blackbox
@@ -56,9 +56,6 @@ corosync_cmapctl_LDADD	= -lcorosync_common -lcmap $(LIBQB_LIBS)
 
 corosync_fplay_LDADD	= $(LIBQB_LIBS)
 
-corosync_pload_LDFLAGS	= $(COMMON_OPTS)
-corosync_pload_LDADD	= -lpload $(LIBQB_LIBS)
-
 corosync_cfgtool_LDFLAGS= $(COMMON_OPTS)
 corosync_cfgtool_LDADD	= -lcfg $(LIBQB_LIBS)
 
diff --git a/tools/corosync-pload.c b/tools/corosync-pload.c
deleted file mode 100644
index 0f2f646..0000000
--- a/tools/corosync-pload.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2008-2011 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Steven Dake (sdake@xxxxxxxxxx)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the MontaVista Software, Inc. nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <unistd.h>
-#include <time.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#include <sys/un.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <corosync/corotypes.h>
-#include <corosync/pload.h>
-
-#ifndef timersub
-#define timersub(a, b, result)					\
-do {								\
-	(result)->tv_sec = (a)->tv_sec - (b)->tv_sec;		\
-	(result)->tv_usec = (a)->tv_usec - (b)->tv_usec;	\
-	if ((result)->tv_usec < 0) {				\
-		--(result)->tv_sec;				\
-		(result)->tv_usec += 1000000;			\
-	}							\
-} while (0)
-#endif /* timersub */
-
-int main (void) {
-	pload_error_t result;
-	pload_handle_t handle;
-
-	result = pload_initialize (&handle, NULL);
-	printf ("Init result %d\n", result);
-	result = pload_start (
-		handle,
-		0, /* code */
-		1500000, /* count */
-		300); /* size */
-	return (0);
-}
-- 
1.7.7.6

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux