Commit Graph

253 Commits

Author SHA1 Message Date
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
Ryan McCabe
2a8ac0a166 fence-virt: Fix fd leak when finding local addresses
Close the netlink fd before returning if recvfrom fails.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-17 13:20:15 -04:00
Ryan McCabe
d093fecd8e fence-virt: Fix possible descriptor leak
Add missing dlclose after loading plugins.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-17 13:20:13 -04:00
Ryan McCabe
85ecac5cff fence-virt: Fix possible fd leak
Fix a fd leak that could occur if reading /dev/urandom failed.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-17 13:20:08 -04:00
Ryan McCabe
c48c06819f fence-virt: Fix null pointer deref
Fix an unlikely null pointer dereference that could occur
subsequent to malloc failing.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-17 13:20:02 -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
9b8bc5ba1c fence-virt: Fix return with lock held
Release the parser mutex before returning if malloc
fails.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-17 13:17:22 -04:00
Ryan McCabe
b35ac70bf2 fence_virt: Fix typo in fence_virt(8) man page
Fix the description of when serial/vmchannel parameters are accepted.

Resolves: rhbz#761228
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-08 10:54:25 -04:00
Ryan McCabe
98e332e243 fence_virt: Return failure for nonexistent domains
Return failure instead of success if a user attempts an operation
on a domain that does not exist.

Resolves: rhbz#853927
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
2012-10-08 10:53:13 -04:00
Ryan McCabe
83d1c3f68e Merge branch 'master' of github.com:ryan-mccabe/fence-virt 2012-07-27 11:22:23 -04:00
Ryan McCabe
30fb5cd5f1 Initial commit 2012-07-27 08:12:05 -07:00
Lon Hohberger
96ff88d44f Improve fence_virt.conf man page description of 'hash'
Signed-off-by: Lon Hohberger <lhh@redhat.com>
Acked-by: Ryan McCabe <rmccabe@redhat.com>
Acked-by: Jaroslav Kortus <jkortus@redhat.com>
2012-07-25 11:11:26 -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
2f87331c1a Stop linking against unnecessary QPid libs.
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-03-26 17:13:37 -04:00
Lon Hohberger
961cc3ed7f Update libvirt-qmf plugin and docs
Resolves: rhbz#753974

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-08 15:46:50 -05:00
Lon Hohberger
d72630b973 Fix crash when we fail to read key file.
If hashing is requested and we have no key data, immediately fail.

Resolves: rhbz#758392

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-08 14:51:01 -05:00
Lon Hohberger
2f819624b3 Fix erroneous man page XML
Resolves: rhbz#761215

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-08 12:13:39 -05:00
Lon Hohberger
af48d0405f Add 'interface' directive to example.conf
Fedora systems require this.

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 16:18:55 -05:00
Lon Hohberger
2b01d8f887 Fix build
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 16:08:26 -05:00
Lon Hohberger
ccff09f2c7 Add old wait_for_backend directive handling & docs
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 16:06:40 -05:00
Lon Hohberger
3e2eb73b41 Return proper error if we can't set up our socket.
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 16:06:28 -05:00
Lon Hohberger
19674ab0bd Fix startup in systemd environments
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 16:03:05 -05:00
Lon Hohberger
9522be50d9 Add systemd unit file and generation
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 14:05:37 -05:00
Lon Hohberger
a1b5a03c38 Don't override user's pick for backend server module
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 11:23:27 -05:00
Lon Hohberger
3f65274331 Use libvirt as default in shipped config
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 11:19:57 -05:00
Lon Hohberger
c8bb151bee Clean up compiler warnings
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 11:14:25 -05:00
Lon Hohberger
e96ef84b3e Fix serial domain handling 2012-02-07 11:04:53 -05:00
Lon Hohberger
5652c743a2 Fix monolithic build
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 10:59:23 -05:00
Lon Hohberger
71ee23d555 Clean up build and comments.
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 10:47:12 -05:00
Lon Hohberger
4a01ebe0f4 Add missing pm_fence source code
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
2012-02-07 10:35:12 -05:00