Commit Graph

285 Commits

Author SHA1 Message Date
Ryan McCabe
286e0c61e4 fence_xvm/fence_virt: Add support for the validate-all status op
Add support for the validate-all status operation. In this mode,
the fence agent will validate the arguments given on either the
command line or standard input. If validation succeeds, it will
exit with code 0, otherwise it will exit with code 1.

Resolves: rhbz#1447700
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2017-05-03 23:22:34 -04:00
Ryan McCabe
53cb4ec362 fence-virt: Add list-status command to man page and metadata
Add the list-status command to the man page and the metadata output.

Resolves: rhbz#908455
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2017-05-03 23:03:23 -04:00
Ryan McCabe
b3ea4870c8 fence-virt: Cleanup numeric argument parsing
Cleanup the parsing of numeric command line arguments.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2017-03-13 17:43:17 -04:00
Ryan McCabe
85eb949759 fence-virt: Log message to syslog in addition to stdout/stderr
Log error and status messages to syslog in addition to stdout and
stderr.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2016-11-11 10:00:50 -05:00
Ryan McCabe
d4cd306cb4 fence-virt: Permit explicitly setting delay to 0
Permit explicitly setting the delay to 0. The fix in
commit 44deba6ee9 for a typo caused a change
in behavior that resulted in an explicitly specified delay of 0 causing an
error.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2016-11-11 09:52:18 -05:00
Ryan McCabe
edb5ee817a fence-virt: Add 'list-status' operation for compat with other agents
Add a list-status operation that behaves the same way as the list operation
for compatibility with the other fence agents.

Resolves: rhbz#908455
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2016-11-01 12:11:22 -04:00
Ryan McCabe
da1ef15db0 Merge pull request #8 from oalbrigt/remove-delay-from-status-monitor-list
Remove delay from the status, monitor and list functions
2016-05-09 10:53:10 -04:00
Andrew Beekhof
87b4eb3d8c Fix use of undefined #define 2016-05-09 15:01:35 +10:00
Andrew Beekhof
988c08442b Allow fence_virtd to run as non-root 2016-05-09 15:01:35 +10:00
Oyvind Albrigtsen
f1f1a2437c Remove delay from the status, monitor and list functions 2016-05-03 15:58:00 +02:00
Ryan McCabe
6d79ea13dd Merge pull request #6 from Thermi/master
daemon_init: Removed PID check and update
2015-09-15 09:17:05 -04:00
Ryan McCabe
7421e1ab26 Merge pull request #5 from jnpkrn/drop-legacy-SysVStartPriority
fence_virtd: drop legacy SysVStartPriority from service unit
2015-08-30 11:25:56 -04:00
Thermi
7916f51d89 daemon_init: Removed PID check and update 2015-08-30 16:01:07 +02:00
Jan Pokorný
16503d909b
fence_virtd: drop legacy SysVStartPriority from service unit
Since systemd-218[1], systemd will emit following lines in the
journal upon (re)loading its configuration:

Support for option SysVStartPriority= has been removed and it is
ignored

As it allegedly had no importance for some time even before, simply
drop it.

[1] http://cgit.freedesktop.org/systemd/systemd/commit/?id=9e37c95

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2015-08-03 18:25:11 +02:00
Ryan McCabe
4a749e3f7d fence-virt: client: Do not truncate VM domains in list output
Don't truncate the domain string for VMs when listing their status
in the output of the list command.

Resolves: rhbz#1207422

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2015-07-17 10:52:01 -04:00
Ryan McCabe
44deba6ee9 Merge pull request #4 from jnpkrn/fix-delay-parameter-checking
client: fix "delay" parameter checking (copy-paste)
2015-03-23 12:36:18 -04:00
Jan Pokorný
f49a7d68d5
client: fix "delay" parameter checking (copy-paste)
Resolves: rhbz#1204873

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2015-03-23 17:33:26 +01:00
Ryan McCabe
630f390d94 fence-virt: Fix broken restrictions on the port ranges
Fix broken port range check.

Resolves: rhbz#1078197

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2015-03-03 13:40:46 -05:00
Ryan McCabe
dbe52e9333 Merge pull request #3 from troxor/clarify-error
Clarify debug message
2015-02-20 11:13:50 -05:00
Troy C
7c48feaddd Clarify debug message 2015-02-20 10:08:09 -06:00
Ryan McCabe
98b0e816ad Merge pull request #2 from masatake/fix-wrong-perror
Fix wrong perror
2015-02-07 16:30:19 -05:00
Masatake YAMATO
99d6fa5746 fence-virtd: Use perror only if the last system call returns an error.
Fix wrong usage of perror. perror is called when data filled
by read system call is shorter than expected. It is not an error
of system call.  In such case perror should not be used.
Similar code can be found in place where write system call is used.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2015-02-08 01:31:36 +09:00
Masatake YAMATO
59b49215ab fence-virtd: Fix printing wrong system call in perror
perror("read") is called after write system call.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2015-02-08 01:31:03 +09:00
Ryan McCabe
2694500ab1 fence-virtd: Allow multiple hypervisors for the libvirt backend
Allow users to specify multiple hypervisor URIs for the
libvirt backend.

.e.g,

backends {
	libvirt {
		uri = "qemu:///system";
		uri1 = "qemu:///system2";
		uri2 = "qemu:///system3";
	}
}

Resolves: rhbz#914144

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2014-06-27 00:07:46 -04:00
Ryan McCabe
97eb067edf fence-virt: Don't overrwrite saved errno
Fix a bug that caused the saved errno value to be overwritten
on an error path.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2014-06-23 15:56:09 -04:00
Ryan McCabe
623f5cfd49 fence-virt: Fix small memory leak in the config module
Fix a small memory leak in the simpleconfig module.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2014-06-23 15:56:09 -04:00
Ryan McCabe
b995766a04 fence-virt: Fix mismatched sizeof in memset call
Fix incorrect argument to sizeof used in a memset call.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2014-06-23 15:56:09 -04:00
Ryan McCabe
10f574f860 fence-virt: Send complete hostlist info
Send all known VM states when we receive a hostlist request.

Resolves: rhbz#1104740

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2014-06-23 15:56:09 -04:00
Ryan McCabe
1589647db4 fence-virt: Clarify the path option in serial mode
Add a clarification for the path option when in serial mode.

Clarified text from Chris Mackowski <cmackows@redhat.com>

Resolves: rhbz#1014238

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2014-06-23 15:56:09 -04:00
Ryan McCabe
224c823eb1 Bump version 2013-11-04 11:08:35 -05:00
Ryan McCabe
cc3f424895 fence-virt: Bump version
Bump version.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2013-11-03 14:01:00 -05:00
Ryan McCabe
09488e9c03 fence_virtd: Fix broken systemd service file
Fix broken systemd service file caused by the inclusion of
network.target, which has been removed.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2013-11-03 12:49:55 -05:00
Ryan McCabe
bf3a1ec00a fence_virt/fence_xvm: Print status when invoked with -o status
Previously no status was printed to stdout when fence_virt and fence_xvm
were invoked with the -o status flag. The exit code of the program was
the only way to determine the result of the status operation. This
patch causes fence_virt and fence_xvm to additionally print
either "Status: ON" or "Status: OFF" when it is able to determine
the status.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2013-11-03 12:44:49 -05:00
Ryan McCabe
61ab01bb5c fence-virt: Fix for missed libvirtd events
Fix a bug that caused some libvirtd events to be missed. This bug could
cause client requests to fail in cases where VMs were either started or live
migrated to a node after fence_virtd had already started.

Resolves: rhbz#903172

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2013-09-13 15:12:00 -04:00
Ryan McCabe
04710b4079 fence-virt: Fail properly if unable to bind the listener socket
Bail out properly in multicast mode if we're unable to bind the TCP
listener socket.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2013-07-10 17:31:21 -04:00
Ryan McCabe
3ee04afd41 Merge pull request #1 from jnpkrn/master
Echoes of recent commits
2012-12-06 11:32:14 -08:00
Jan Pokorný
5ac1d63528 client: dump all arguments structure in debug mode
In longer term, there should be a proper split of common/dedicated
arguments between modes (disjunct fields via union?) and also
args_print should dump the arguments as per mode.

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2012-12-04 23:04:25 +01:00
Jan Pokorný
60e14071b7 Drop executable flag for man pages (finally)
Accidentally, 8cda792ac5 did only a part
of it.

Reported-by: Lon Hohberger <lhh@redhat.com>
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2012-12-04 22:37:20 +01:00
Jan Pokorný
dc9120ce24 Honor implicit "ip_family=auto" in fence_xvm w/IPv6 mult.addr.
Previously this wasn't the case:

$ ./fence_xvm -d -a ff05::3:1 -H asdfaf
-- args @ 0x7fffb9575340 --
  args->domain = asdfaf
  args->op = 2
  args->net.key_file = /etc/cluster/fence_xvm.key
  args->net.hash = 2
  args->net.addr = ff05::3:1
  args->net.auth = 2
  args->net.port = 1229
  args->net.ifindex = 0
  args->net.family = 2
  args->timeout = 30
  args->retr_time = 20
  args->flags = 0
  args->debug = 1
-- end args --
[...]

args->net.family is being assigned value of PF_INET (2) instead of
PF_INET6 (10) as it ought to be with implicit "auto" value as declared, e.g.,
in metadata:

<parameter name="ip_family">
	<getopt mixed="-i" />
	<content type="string" default="auto" />
	<shortdesc lang="en">IP Family ([auto], ipv4, ipv6)</shortdesc>
</parameter>

After the fix, we get the expected behavior when using IPv6 multicast
address:

$ ./fence_xvm -d -a ff05::3:1 -H asdfaf
-- args @ 0x7fffe4af7120 --
  args->domain = asdfaf
  args->op = 2
  args->net.key_file = /etc/cluster/fence_xvm.key
  args->net.hash = 2
  args->net.addr = ff05::3:1
  args->net.auth = 2
  args->net.port = 1229
  args->net.ifindex = 0
  args->net.family = 10
  args->timeout = 30
  args->retr_time = 20
  args->flags = 0
  args->debug = 1
-- end args --
[...]

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2012-11-27 13:52:59 -05:00
Jan Pokorný
57ffe8bf9f Fix using bad struct item for auth algorithm
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2012-11-27 13:31:22 -05:00
Jan Pokorný
8cda792ac5 Drop executable flag for man pages
Reported-by: rpmlint <http://rpmlint.zarb.org/cgi-bin/trac.cgi>
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2012-11-27 13:31:20 -05:00
Dan Horák
c3d398645d use bswap_X() instead of b_swapX()
byteswap.h defined interface is bswap_X() not b_swapX()
2012-11-16 13:07:41 -05:00
Ryan McCabe
7231adafcb fence_virtd: Fix memcpy size params in the TCP plugin
Fix the size param of the memcpy calls in the TCP plugin.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-26 18:15:53 -04:00
Ryan McCabe
5e7e247f00 Revert "fence-virt: Fix possible descriptor leak"
This reverts commit d093fecd8e.
2012-10-26 18:15:31 -04:00
Ryan McCabe
0de5dd3ac9 fence_virtd: Return success if a domain exists but is already off.
Return success if a domain exists but is already off.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-26 18:14:45 -04:00
Ryan McCabe
fc7d6bf464 fence-virt: Add back missing tcp_listener.h file
Add back AWOL header file.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-18 19:38:00 -04:00
Ryan McCabe
0004a70072 fence-virt: Fix a few fd leaks
Fix a few places where descriptors could leak in the client code.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-17 13:32:16 -04:00
Ryan McCabe
10df3451a6 fence-virt: Fix free of uninitialized variable
Fix a possible free() of an uninitialized struct member in
the error path that's hit in an OOM situation.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-17 13:20:24 -04:00
Ryan McCabe
7774713dce fence-virt: Fix possible null pointer dereference
Fix a possible null pointer dereference in the config parser.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-17 13:20:22 -04:00
Ryan McCabe
09c434dfe5 fence-virt: Fix memory leak
Fix memory leak that occurred when setting up
the multicast socket failed.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-17 13:20:16 -04:00