Re: [PATCH 1/9] CTS: init votequorum by default

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

 



ACK the whole patch set.

I also noticed that we carry around an unrequired quorum.quorate option
around. I am about to send a patch to drop it and you can update your
patch 7/9 or simply add an incremental one.

Fabio

On 1/27/2012 7:50 AM, Angus Salkeld wrote:
> Signed-off-by: Angus Salkeld <asalkeld@xxxxxxxxxx>
> ---
>  cts/agents/votequorum_test_agent.c |   43 +++++++++++------------------------
>  cts/corosync.py                    |    6 -----
>  2 files changed, 14 insertions(+), 35 deletions(-)
> 
> diff --git a/cts/agents/votequorum_test_agent.c b/cts/agents/votequorum_test_agent.c
> index f0dcb01..b27d1da 100644
> --- a/cts/agents/votequorum_test_agent.c
> +++ b/cts/agents/votequorum_test_agent.c
> @@ -88,8 +88,6 @@ static int vq_dispatch_wrapper_fn (
>  		qb_log (LOG_ERR, "got %s error, disconnecting.",
>  			cs_strerror(error));
>  		votequorum_finalize(vq_handle);
> -		qb_loop_poll_del (ta_poll_handle_get(), fd);
> -		close (fd);
>  		vq_handle = 0;
>  		return -1;
>  	}
> @@ -106,8 +104,6 @@ static int q_dispatch_wrapper_fn (
>  		qb_log (LOG_ERR, "got %s error, disconnecting.",
>  			cs_strerror(error));
>  		quorum_finalize(q_handle);
> -		qb_loop_poll_del (ta_poll_handle_get(), fd);
> -		close (fd);
>  		q_handle = 0;
>  		return -1;
>  	}
> @@ -171,22 +167,6 @@ static int q_lib_init(void)
>  	return ret;
>  }
>  
> -static void lib_init (int sock)
> -{
> -	int ret;
> -	char response[100];
> -
> -	snprintf (response, 100, "%s", OK_STR);
> -	ret = q_lib_init ();
> -
> -	if (ret != CS_OK) {
> -		snprintf (response, 100, "%s", FAIL_STR);
> -		qb_log (LOG_ERR, "q_lib_init FAILED: %d", ret);
> -	}
> -
> -	send (sock, response, strlen (response), 0);
> -}
> -
>  static void getinfo (int sock)
>  {
>  	int ret;
> @@ -280,21 +260,25 @@ static void context_test (int sock)
>  {
>  	char response[100];
>  	char *cmp;
> +	cs_error_t rc1;
> +	cs_error_t rc2;
>  
>  	snprintf (response, 100, "%s", OK_STR);
>  
> -	votequorum_context_set (vq_handle, response);
> -	votequorum_context_get (vq_handle, (void**)&cmp);
> +	rc1 = votequorum_context_set (vq_handle, response);
> +	rc2 = votequorum_context_get (vq_handle, (void**)&cmp);
>  	if (response != cmp) {
>  		snprintf (response, 100, "%s", FAIL_STR);
> -		qb_log (LOG_ERR, "votequorum context not the same");
> +		qb_log (LOG_ERR, "votequorum context not the same %d %d",
> +			rc1, rc2);
>  	}
>  
> -	quorum_context_set (q_handle, response);
> -	quorum_context_get (q_handle, (const void**)&cmp);
> +	rc1 = quorum_context_set (q_handle, response);
> +	rc2 = quorum_context_get (q_handle, (const void**)&cmp);
>  	if (response != cmp) {
>  		snprintf (response, 100, "%s", FAIL_STR);
> -		qb_log (LOG_ERR, "quorum context not the same");
> +		qb_log (LOG_ERR, "quorum context not the same %d %d",
> +			rc1, rc2);
>  	}
>  	send (sock, response, strlen (response) + 1, 0);
>  }
> @@ -303,6 +287,8 @@ static void do_command (int sock, char* func, char*args[], int num_args)
>  {
>  	char response[100];
>  
> +	q_lib_init ();
> +
>  	qb_log (LOG_INFO,"RPC:%s() called.", func);
>  
>  	if (strcmp ("votequorum_getinfo", func) == 0) {
> @@ -313,11 +299,10 @@ static void do_command (int sock, char* func, char*args[], int num_args)
>  		setexpected (sock, args[0]);
>  	} else if (strcmp ("quorum_getquorate", func) == 0) {
>  		getquorate (sock);
> -	} else if (strcmp ("init", func) == 0) {
> -		lib_init (sock);
>  	} else if (strcmp ("context_test", func) == 0) {
>  		context_test (sock);
> -	} else if (strcmp ("are_you_ok_dude", func) == 0) {
> +	} else if (strcmp ("are_you_ok_dude", func) == 0 ||
> +	           strcmp ("init", func) == 0) {
>  		snprintf (response, 100, "%s", OK_STR);
>  		send (sock, response, strlen (response) + 1, 0);
>  	} else {
> diff --git a/cts/corosync.py b/cts/corosync.py
> index b8c4edb..b91843a 100644
> --- a/cts/corosync.py
> +++ b/cts/corosync.py
> @@ -655,12 +655,6 @@ class VoteQuorumTestAgent(TestAgent):
>          self.nodeid = None
>          self.send_recv = True
>  
> -    def start(self):
> -        if not self.started:
> -            TestAgent.start(self)
> -            self.init()
> -            self.used = False
> -
>  AllAuditClasses = []
>  AllAuditClasses.append(LogAudit)
>  AllAuditClasses.append(ShmLeakAudit)

_______________________________________________
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