61 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 44deba6ee915e9c7079f244b70900b56bdec86d8 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
Oyvind Albrigtsen
f1f1a2437c Remove delay from the status, monitor and list functions 2016-05-03 15:58:00 +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
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
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
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
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
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ý
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
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
0c502aad77 fence-virt: Explicitly set delay to 0
Explicitly set the delay argument to 0 when initializing the args
struct.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-17 13:19:56 -04:00
Ryan McCabe
fb992c7d0f Add a delay (-w) option.
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-06-07 18:10:49 -04:00
Ryan McCabe
4c0038cb92 Remove duplicated port struct entry
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-06-01 16:03:59 -04:00
Ryan McCabe
f61626c108 Add a TCP listener plugin for use with viosproxy
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-06-01 15:22:02 -04:00
Ryan McCabe
52381ce2b7 In serial mode, return failure if the other end closes the connection
before we see SERIAL_MAGIC in the reply or timeout.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-05-16 09:15:42 -04:00
Lon Hohberger
f7ccaa261a Fix static analysis errors
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2011-09-20 11:40:39 -04:00
Lon Hohberger
200eab4149 Make listen() retry
Pacemaker requires this in order to operate.  Multiple fencing requests
will not come from a single host, however, it is possible that multiple
instances of fence_xvm will need to run at approximately the same time.

e.g. one 'status' or 'hostlist', one fencing action.

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2011-09-19 16:21:14 -04:00
Lon Hohberger
53a2b293d1 Ensure we don't try to strdup() or atoi() on NULL
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2011-09-09 18:22:36 -04:00
Lon Hohberger
19858bfbde Fix incorrect return value on hash mismatch
Resolves: rhbz720767

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2011-08-03 10:21:44 -04:00
Lon Hohberger
3006e19e41 Make fence-virt requests endian clean
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2011-07-06 12:17:42 -04:00
Lon Hohberger
cb64c8c89f Fix input parsing to allow domain again
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2011-06-28 17:09:02 -04:00
Lon Hohberger
c3427373c8 Provide 'domain' in metadata output for compatibility
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2011-06-27 12:39:10 -04:00
Lon Hohberger
baa344b575 Fix metadata output
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-02-10 13:32:38 -05:00
Lon Hohberger
0358a4e5ea Rename parameters to match other fencing agents
port -> ipport (IP port to use)
domain -> port (VM to fence)

Resolves: rhbz#561418

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-02-03 15:07:17 -05:00
Lon Hohberger
1e95e2c9fc client: Clarify license in serial.c
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-25 13:24:54 -05:00
Lon Hohberger
30481d4cc9 Return 2 for 'off' like other fencing agents
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-15 08:06:34 -05:00
Lon Hohberger
b384f3bd31 More parity with other fencing agents' parameters
- use 'list' instead of 'hostlist'
- replace 'devstatus' with 'monitor'

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-14 19:26:21 -05:00
Lon Hohberger
c7699c1ac6 Fix build warnings in client/serial.c
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-14 16:41:21 -05:00
Lon Hohberger
450ffdb26a Add 'monitor' as an alias for 'status'
Makes the CRM happier.

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-14 16:26:58 -05:00
Lon Hohberger
fdc9fc9b58 Add missing 'metadata' option to help text
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-14 16:05:57 -05:00
Lon Hohberger
d19a48a6b8 Add metadata support to fence_xvm/fence_virt
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-14 15:26:53 -05:00
Lon Hohberger
f665796f26 Enable VM Channel support in serial plugin
- Add cmdline processing for channel_ip
- Allow 'port' to be used in fence_virt mode
- Allow configuration of vmchannel mode for fence_virtd
  serial plugin
- Remove serial port default from fence_virt.
  It must now be specified or else VM Channel mode
  is used.  Note that to use VM Channel mode, you need:
    qemu 0.12.1 or later
    libvirt 0.7.3 or later
- Update man pages

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-13 23:34:35 -05:00
Lon Hohberger
ae8bdd8461 Use seqno in serial requests
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-13 10:13:14 -05:00
Lon Hohberger
726e40673e Static map support and permissions reporting
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-13 09:26:32 -05:00
Lon Hohberger
ac1b594c75 Sync up on SERIAL_MAGIC while waiting for a response
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-13 08:37:41 -05:00
Lon Hohberger
30e8654e77 Initial checkin of serial server-side support
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-13 02:20:38 -05:00
Lon Hohberger
1a1c02b11d Fix up help text for clients
* Output defaults from includes rather than static text
* Add simple wrapping functions for help text

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-12 17:18:41 -05:00
Lon Hohberger
c7209147c2 Split fence_virt vs. fence_xvm args
Fence_virt -h and fence_xvm -h now produce
meaningful output

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2010-01-09 14:20:59 -05:00
root
4d7839abce Hostlist functionality for libvirt, libvirt-qpid
Signed-off-by: root <lon@users.sourceforge.net>
2009-12-07 12:55:48 -05:00
Lon Hohberger
53d5164dcb Fix agent option parsing
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2009-11-19 11:00:16 -05:00
Lon Hohberger
4f870c4fd0 Make symlink/compatibilty mode disabled by default
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2009-09-23 12:04:32 -04:00
Lon Hohberger
9931f5f4e7 Fix package name and install locations
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2009-09-17 15:16:24 -04:00
Lon Hohberger
705b5a18d7 Fix build errors on Fedora
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2009-09-17 14:11:08 -04:00
Lon Hohberger
9935a3077d Enable 'on' operation for libvirt backend
Signed-off-by: Lon Hohberger <lhh@redhat.com>
2009-09-15 15:24:56 -04:00