Commit Graph

18 Commits

Author SHA1 Message Date
Christine Caulfield
7b96a937df log: Configure knet logging to the same as corosync
Before this, all knet messages, including debug, were sent
over the pipe from knet to corosync and filtered in corosync.
This was obviously a waste, so now we tell knet the logging
level we need from it and so only get the messages that the
user has requested.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2022-03-31 17:29:20 +02:00
Jan Friesse
52d457a455 config: Properly check crypto and compress models
Use knet_get_crypto_list to find knet supported crypto models and use
them instead of hardcoded list.

Also fix compression handling. Previously knet_compression_model
value was not checked at all and was directly passed to knet.

Use knet_get_compress_list to find knet supported compress models and
use them to check validity of config file and for more informative
error message.

Lastly enhance corosync version display with information
about available crypto/compression models.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2021-04-14 18:07:20 +02:00
Jan Friesse
5731af2782 logging: Add CS_PRI_NODE_ID and CS_PRI_RING_ID
Previously node id was logged ether as a %d (most often), %u, %x or
PRI.32 and ring id ether as %lld, %llx with various separators (., :, /)
between rep nodeid and seq. This seems to cause confusion.

This patch adds macros CS_PRI_NODE_ID, CS_PRI_RING_ID and
CS_PRI_RING_ID_SEQ (CS prefix = corosync, PRI modeled in spirit of
inttypes.h PRIx32) and makes code use them.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2019-07-03 10:53:52 +02:00
Jan Friesse
49641b9a8f vqsim: Fix gitignore
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-07-02 10:34:08 +02:00
Jan Friesse
0390200dd4 vqsim: Check length of copied optarg
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2019-06-12 15:40:53 +02:00
Jan Friesse
1d8c1a4c97 vqsim: Check result of icmap_set_uint32
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2019-06-12 15:40:52 +02:00
Jan Friesse
ef9b931b7e vqsim: Remove unused total_nodes
... and remove unused nodes_in_partition function.

Also replace TAILQ_FOREACH with goto to while cycle.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2019-06-12 15:40:52 +02:00
Jan Friesse
215d2e30b2 vqsim: Free allocated newvq on error
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2019-06-12 15:40:52 +02:00
Jan Friesse
7267149e05 vqsim: Check length of received message
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2019-06-12 15:40:52 +02:00
Jan Friesse
e953cfeb87 vqsim: Check write result
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2019-06-12 15:40:52 +02:00
Jan Friesse
1af23e9c2d vqsim: Do not access unitialized argv[0]
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2019-06-12 15:40:51 +02:00
Christine Caulfield
c3d69712c6 vqsim: Enhance vqsim
1. Enable scripting of vqsim and add man page

I've added a 'sleep' command to help with scripting as well as
documentation on how to do it.

2. Make 'sync' operation much more robust and useful

Refactored a lot of code to make sure that in sync mode the
prompt appears at the 'right' time. What we do is wait for all
of the nodes in all partitions to have the same ring_id. If this
doesn't happen then the timeout will fire as before.

3. Rename binary to corosync-vqsim and add a sub-package for it

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2019-05-13 11:04:24 +02:00
Christine Caulfield
e65d7b5d98 vqsim: Fix vqsim for corosync 3.0
A couple of small internal changes in corosync 3.0 broke vqsim.
1) The way the custom config file is specified (no long an env variable)
2) votequorum now needs to know ouZ_node_pos

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2019-04-25 16:50:51 +02:00
Jan Friesse
e287a7c1ef vqsim: Make vqsim compile
Also add vqsim binary to .gitignore.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2019-04-24 14:34:17 +02:00
Bin Liu
3252307de3 Fix compile errors in qdevice and vqsim on FreeBSD
Some header files need to be specified on FreeBSD, otherwise there
are compile errors. These files does not affect Linux compilation.

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2017-12-05 18:51:02 +01:00
Takeshi MIZUTA
4939c75629 Remove redundant header file inclusion
Signed-off-by: Takeshi MIZUTA <miz.take4@gmail.com>
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2016-12-05 09:59:08 +01:00
Christine Caulfield
7523a5b40c vqsim: Fix Makefile.am
Make it conditional on BUILD_VQSIM being defined

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-10-13 14:59:12 +01:00
Christine Caulfield
71e885d7f9 vqsim: Add Quorum simulator program
vqsim is a small program that allows node up/down/split/join
operations to be simulated without the use of an actual cluster.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
2016-10-13 14:21:04 +01:00