1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

475 Commits

Author SHA1 Message Date
Alasdair Kergon
8544a8a254 Rename vg_read() to vg_read_internal(). (mornfall) 2009-01-26 19:01:32 +00:00
Christine Caulfield
f2042acc7f Add a corosync/DLM cluster service to clvmd.
It's not integrated in the configure system yet though.
2009-01-22 10:21:12 +00:00
Jonathan Earl Brassow
bf0378593c Initial import of the cluster log daemon from the 'cluster' repository.
There is a rudimentary make file in place so people can build by hand
from 'LVM2/daemons/clogd'.  It is not hooked into the main build system
yet.  I am checking this in to provide people better access to the
source code.

There is still work to be done to make better use of existing code in
the LVM repository.  (list.h could be removed in favor of existing list
implementations, for example.  Logging might also be removed in favor
of what is already in the tree.)

I will probably defer updating WHATS_NEW_DM until this code is linked
into the main build system (unless otherwise instructed).
2009-01-08 17:12:33 +00:00
Dave Wysochanski
0296197999 Create global is_static() to eliminate from the library init function.
Very simple / crude method of removing 'is_static' from initialization.
Why should we require an application tell us whether it is linked
statically or dynamically to libLVM?  If the application is linked
statically, but libraries exist and dlopen() calls succeed, why
do we care if it's statically linked?
2008-12-18 05:27:17 +00:00
Dave Wysochanski
c5c13fe776 Remove struct arg * from struct cmd_context and create_toolcontext().
This allows us to remove one argument from create_toolcontext() and
moves it closer to a generic library init function.

In the arg_*() functions, we just use _the_args() directly.
For now we leave the first parameter to these
arg_*() functions (struct cmd_context *) because
of the number of files involved in removing the
parameter.
2008-12-17 16:46:45 +00:00
Dave Wysochanski
f059ab7150 Remove redundant set_activation() call after create_toolcontext() calls.
Very similar argument to removal of init_debug() and other calls.

create_toolcontext() calls _process_config() which sets
cmd->default_settings.activation, then calls
set_activation(cmd->default_settings.activation).  Later, create_toolcontext()
sets cmd->current_settings = cmd->default_settings.  So these calls
set_activation(cmd->current_settings.activation) are redundant.
2008-12-11 03:34:12 +00:00
Dave Wysochanski
a51b3f838d Remove backup_enable() calls after create_toolcontext() calls.
Identical argument to previous patch which removed archive_enable() calls.
We add a new parameter to backup_init() which sets the enable value based
on the cmd->default_settings.backup value.  This value was used to set
cmd->current_settings.backup, used in the removed backup_enable() call.
2008-12-11 03:33:35 +00:00
Dave Wysochanski
4fa2c7f8b6 Remove archive_enable() calls after create_toolcontext() calls.
_init_backup() calls archive_init(), which originally set 'enabled' to
a hardcoded '1' value.  This seems incorrect based on my read of other
areas of the code so here we add a 'enabled' paramter to archive_init().
We pass in cmd->default_settings.archive, which is obtained from the
config tree.  Later in create_toolcontext, cmd->current_settings is
set to cmd->default_settings.  The archive_enable() call we remove
here was using cmd->current_settings to set the 'archive' enable
value.  The final value of cmd->archive_params->enabled should thus
be equivalent to the original code.
2008-12-11 03:32:56 +00:00
Dave Wysochanski
6f4c0fb93d Remove init_verbose() calls immediately after create_toolcontext() calls.
The rationale for removing init_verbose() call is very similar to removing
init_debug() call.  create_toolcontext() calls _init_logging() which
makes these calls:
        /* Verbose level for tty output */
        cmd->default_settings.verbose =
            find_config_tree_int(cmd, "log/verbose", DEFAULT_VERBOSE);
        init_verbose(cmd->default_settings.verbose + VERBOSE_BASE_LEVEL);

And being that create_toolcontext() copies default_settings into
current_settings at the bottom, the init_verbose() call we are removing:
        init_verbose(cmd->current_settings.verbose + VERBOSE_BASE_LEVEL);

is redundant.
2008-12-11 03:30:19 +00:00
Dave Wysochanski
fb19b83ff2 Remove init_debug() calls immediately after create_toolcontext() call.
We can safely remove because create_toolcontext() calls _init_logging(),
which makes these calls:
        /* Debug level for log file output */
        cmd->default_settings.debug =
            find_config_tree_int(cmd, "log/level", DEFAULT_LOGLEVEL);
        init_debug(cmd->default_settings.debug);

Then at the bottom of create_toolcontext() we do this:
        cmd->current_settings = cmd->default_settings;

So the call we are removing from init_lvm() functions (clvmd and lvmcmdline):
        init_debug(cmd->current_settings.debug);

Just sets the value of debug based on 'cmd->current_settings.debug'.
Since cmd->current_settings is equivalent to cmd->default_settings, and
init_debug() was called with cmd->default_settings, the call we remove is
redundant.
2008-12-11 03:29:37 +00:00
Christine Caulfield
acc4138895 Fix a starup race in clvmd that could result in huge waits for the first command to be processed. 2008-11-21 13:48:00 +00:00
Alasdair Kergon
77b69aa724 make install_device-mapper 2008-11-04 17:25:32 +00:00
Alasdair Kergon
7f78616f3d clvmd 2008-11-04 16:41:47 +00:00
Alasdair Kergon
a479de2e75 dmeventd 2008-11-04 15:55:27 +00:00
Alasdair Kergon
56d8844068 more fixes 2008-11-04 15:07:45 +00:00
Alasdair Kergon
d4b9af444c more tweaks for dmeventd - not finished yet 2008-11-03 23:01:21 +00:00
Alasdair Kergon
2c44337bd5 Right, a simple build (without options) is working again. 2008-11-03 22:14:30 +00:00
Alasdair Kergon
b7edb5bfa7 dmeventd plugins move 2008-10-31 22:29:44 +00:00
Milan Broz
ffc4a05bda Fix snapshot monitoring library to not cancel monitoring invalid snapshot.
snapshot DSO unregistered itself when snapshot changed state to invalid.

This can cause a race (and several timeouts), when for example another snapshot
is added and in the middle of operation (suspend/resume) the monitoring thread
unregister itself.

Fix it by keeping the snapshot monitored after invalidation - just reset
threshold to not really print any messages to syslog.
2008-10-13 12:06:30 +00:00
Alasdair Kergon
68f2de6d4a Add usrlibdir & usrsbindir to configure. 2008-10-07 19:11:59 +00:00
Milan Broz
550463b5e1 Fix mirror DSO to call vgreduce with proper parameters. 2008-09-25 15:52:29 +00:00
Alasdair Kergon
6e410af1d6 fix last release 2008-09-19 15:44:03 +00:00
Alasdair Kergon
8c5bcdabab Improve the way VGs with PVs missing are handled so manual intervention
is required in fewer circumstances.  (mornfall)
2008-09-19 06:42:00 +00:00
Petr Rockai
8153260792 Add #include <signal.h> to dmeventd.c, fixes compilation on NetBSD. 2008-07-09 13:26:07 +00:00
Petr Rockai
2a9a80c9bb Fix dmeventd regression where mirror and snapshot monitoring libraries
failed to link against liblvm2cmd.

Dmeventd DSOs *require* lvm2cmd to be linked in.

For the future:
1) AC_SUBST does not create Makefile variables, only @foo@-style substitutions
2) When using `test', whitespace around `=' is essential:
    test a=b is true, as is test a=a
2008-07-09 09:59:42 +00:00
Zdenek Kabelac
c454025a0f Added generation of the versioned libdevmapper-event.so for LVM's test 2008-06-27 15:36:51 +00:00
Jim Meyering
aa4d1e3106 avoid link failure when configuring without --enable-cmdlib
* configure.in (LVM2CMD_LIB): Define if --enable-cmdlib.
* dmeventd/mirror/Makefile.in (CLDFLAGS): Use $(LVM2CMD_LIB) rather
than hard-coding -llvm2cmd.
* dmeventd/snapshot/Makefile.in (CLDFLAGS): Likewise.
2008-06-23 09:25:08 +00:00
Christine Caulfield
f3c3494c86 Make clvmd return immediately if other nodes are down in an openais cluster. 2008-06-20 12:46:21 +00:00
Christine Caulfield
7515a2cacc Make clvmd return immediately if other nodes are down in a gulm cluster.
bz#447799
2008-06-20 10:58:28 +00:00
Christine Caulfield
b1f8aa24ca Don't call openlog for every invocation of debuglog.
Patch from Masatake YAMATO
2008-06-13 07:44:14 +00:00
Alasdair Kergon
cbb0489782 cleaner LCK_LV decoding 2008-06-06 16:37:51 +00:00
Alasdair Kergon
e350c2f648 Decode numbers in clvmd debugging output. 2008-06-05 14:24:28 +00:00
Alasdair Kergon
25fbec5be1 revert accidental checkin 2008-05-19 20:06:34 +00:00
Alasdair Kergon
fc54be1062 Refactor some vginfo manipulation code. 2008-05-19 19:49:56 +00:00
Alasdair Kergon
3dfd8f12dc more cleanup 2008-05-09 19:26:58 +00:00
Alasdair Kergon
98fd1ce332 More P_ and V_ lock cleanup. 2008-05-09 18:45:15 +00:00
Alasdair Kergon
3d6af3e35e Add missing mutex around clvmd lvmcache_drop_metadata library call. 2008-05-09 15:13:20 +00:00
Christine Caulfield
5e91e174d3 Fix uninitialised mutex in clvmd if all daemons are not running at startup.
Thanks to Mark Hlawatschek for pointing this out.
2008-05-09 09:59:39 +00:00
Christine Caulfield
b1bf5f1738 Make clvmd-cman use a hash rather than an array for node updown info.
This will allow it to cope with very large nodeids such as those
generated by clusters using cman_tool join -X
2008-05-09 07:20:04 +00:00
Christine Caulfield
d474909a58 . remove_lock_wait.diff remove the definition of "struct lock_wait",
which is not used since the switch away from async version saLck
. num_nodes should equal to member_list_entries, i.e.
joined_list_entires is 0 when a node leaves the group.

Thanks to Xinwei Hu for the patch.
2008-04-29 08:55:20 +00:00
Christine Caulfield
746e7dc42e The attached patch is a try to make clvmd work correctly on openais stack.
It does 2 things.

1. The cpg_deliver_callback make a compare between target_nodeid and our_nodeid.
It turns out openais set target_nodeid to 0 sometimes. for broadcasting ? I change the behavior so that lvm will process_remote also on target_nodeid == 0

2. The joined_list passed to cpg_confchg_callback doesn't include the already exist nodes in the group, which leads to an incomplete node_hash. I simply add all other nodes in member_list to node_hash also.

Thanks to Xinwei Hu for this patch.
2008-04-28 08:57:11 +00:00
Christine Caulfield
9ba7d6d08b Simplify locking code by using saLckResourceLock rather than
saLckResourceLockAsync.

Thanks to Xinwei Hu for the patch.
2008-04-23 09:53:49 +00:00
Milan Broz
581b17def2 Drop cached VG metadata before and after committing changes to it. 2008-04-15 14:46:19 +00:00
Alasdair Kergon
adb578238d rename P_global to P_#global 2008-04-15 11:36:46 +00:00
Christine Caulfield
e8d3d71e23 Add config file overrides to clvmd when it reads the LVs list so that
config items 'command_names' and 'prefix' don't prevent it working.
2008-04-08 13:03:13 +00:00
Christine Caulfield
ec074fcf64 If lvm.conf was touched, clvmd attempted to update the toolcontext
but only did half of the job. It now shares the do_refresh_cache()
function that vgscan invokes.
2008-04-04 08:53:47 +00:00
Christine Caulfield
611c0689fc Fix another allocation bug with clvmd and large node IDs.` 2008-04-01 15:01:30 +00:00
Christine Caulfield
2aa5120e82 Fix a couple of uninitialised variables. The newfd one could cause
some obscure hangs.
2008-03-28 12:58:09 +00:00
Christine Caulfield
7750a1ade6 When reallocating the node IDs array, make it bigger rather than smaller! 2008-03-25 10:41:59 +00:00
Christine Caulfield
ed070f4105 Fix potential thread deadlock.
Also make local sockets non-blocking.
2008-03-17 09:37:47 +00:00
Christine Caulfield
66db5dd894 Include limits.h so it compiles with newer headers. 2008-03-06 08:41:05 +00:00
Jim Meyering
4349becadc Remove redundant if-before-free tests in clvmd.c. 2008-02-15 14:12:32 +00:00
Patrick Caulfield
08152c90f2 Update usage message for clvmd.
Fix clvmd man page printing <br>, clarified debug options.
2008-02-05 09:38:04 +00:00
Alasdair Kergon
4e9083db10 Fix mirror log name construction during lvconvert. (2.02.30)
Make monitor_dev_for_events recurse through the stack of LVs.
Clean up some more compiler warnings.
Add mirror names test script.
2008-01-31 12:19:36 +00:00
Patrick Caulfield
5a3f869f7e Remove redundant cnxman-socket.h file. 2008-01-21 14:07:46 +00:00
Petr Rockai
a98a2d4a4e Amend previous commit. * does not match .files... 2008-01-09 15:33:25 +00:00
Petr Rockai
67961c7c10 Add snapshot dmeventd library (enables dmeventd snapshot monitoring). 2008-01-09 15:32:19 +00:00
Patrick Caulfield
8a0a9a93d9 Tidy the clvmd backup code.
Move the backups inside the protection of the VG lock,
Don't backup if we have a suspended LV
Correct the vg_read() call
2007-12-05 13:17:18 +00:00
Patrick Caulfield
3303289137 When we unlock a VG tell the clvmds to see if a backup of the metadata needs
to be done.
2007-12-04 15:39:26 +00:00
Petr Rockai
cd1a7e80c0 Fix a possible double-free in libdevmapper-event. 2007-11-27 12:26:06 +00:00
Patrick Caulfield
37034fb826 If the pre_command fails then go back and wait patiently for the next
pre function rather than retrying it until we get stuck!
2007-11-15 10:16:14 +00:00
Patrick Caulfield
96b250d625 Make it compile with new lv_info_by_lvid() prototype 2007-11-14 13:37:51 +00:00
Jim Meyering
7f8f8bfa09 Correct typo in comments: s/is part of the LVM2/is part of LVM2/.
Signed-off-by: Jim Meyering <jim@meyering.net>


Author: Jim Meyering <jim@meyering.net>
2007-09-21 10:16:45 +00:00
Patrick Caulfield
d2fb8b66d7 Fix clvmd logging so you can get lvm-level debugging out of it. 2007-08-24 08:29:39 +00:00
Patrick Caulfield
5982271096 Locking P_global causes a cache refresh. 2007-08-23 15:43:20 +00:00
Patrick Caulfield
f608f30407 Force a device scan after init_full_scan_done() per agk. 2007-08-23 12:44:09 +00:00
Patrick Caulfield
88fc506bf0 Call init_full_scan_done() when refreshing the cache. This should fix clvmd -R. 2007-08-23 12:19:13 +00:00
Alasdair Kergon
147d5faccf Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-21 16:26:07 +00:00
Patrick Caulfield
be313b1300 Allow clvmd debug to be turned on in a running daemon using clvmd -d
You can do with cluster-wide too, by adding -C
2007-08-17 11:51:23 +00:00
Jim Meyering
08c9ff434b Add "const" attributes where possible: first cut. 2007-08-07 09:06:05 +00:00
Alasdair Kergon
27c7135097 Use NULL not 0.
Remove worthless comment.
2007-08-05 00:13:02 +00:00
Petr Rockai
674cfe8071 Fix a possible segfault in libdevmapper-event. Thanks to Brian J. Wood
for noticing this.
2007-08-02 22:31:59 +00:00
Milan Broz
3c11686036 Fix clvmd if compiled with gulm support. (2.02.26) 2007-07-24 15:35:11 +00:00
Jim Meyering
f28fd56f76 libdevmapper, dmeventd: be paranoid about detecting write failure
* dmeventd/dmeventd.c (_set_oom_adj): When writing to /proc/self/oom_adj,
detect failure even if it's hidden behind ferror.  [Using dm_fclose's
extra ferror test here is probably not needed, since the amount written
is nowhere near BUFSIZ, but use it regardless, for consistency. ]
* lib/fs/libdevmapper.c (do_suspend): Detect fclose failure when
writing to suspend.
2007-07-24 14:16:48 +00:00
Jim Meyering
bbcd24607c Use gcc's printf attribute wherever possible.
* daemons/clvmd/clvmd.h (debuglog): Add __attribute__((printf)).
* lib/config/config.c (_line_append): Likewise.
* lib/misc/lvm-string.h (emit_to_buffer): Likewise.
2007-07-20 15:38:19 +00:00
Patrick Caulfield
b3ae66ae58 Tidy bits of clvmd-openais and improve an error report. 2007-07-11 12:07:39 +00:00
Patrick Caulfield
8e2f036193 Use cpg_local_get() rather then Clm to get the local nodeid. 2007-06-25 09:02:37 +00:00
Patrick Caulfield
f3864a94d2 Remove system-lv.[ch] 2007-06-14 10:17:12 +00:00
Patrick Caulfield
8ef3cec1f8 Remove system LV code from clvmd. It's never been used and never should be
used! It's removal tidies a number of code paths inside clvmd.
2007-06-14 10:16:35 +00:00
Patrick Caulfield
59231b568a Add *Experimental* OpenAIS support to clvmd. 2007-05-21 10:52:01 +00:00
Patrick Caulfield
e1cd6dbc07 Misc clvmd cleanups from Jim Meyering 2007-05-02 12:22:40 +00:00
Patrick Caulfield
f46af53ea3 Add some more debuglogs to clvmd startup. 2007-05-02 08:23:36 +00:00
Alasdair Kergon
1bf5aae913 Change some #include lines to search only standard system directories. 2007-04-27 17:46:16 +00:00
Patrick Caulfield
05aa860fd7 Fix thread race in clvmd. 2007-04-24 15:13:13 +00:00
Petr Rockai
6e23a8aa20 Fix the regression introduced by dmeventd leak fixes. 2007-04-24 13:29:02 +00:00
Petr Rockai
727f266227 Fix some memory leaks in dmeventd. 2007-04-23 15:06:03 +00:00
Patrick Caulfield
0b65565e6b Make clvmd cope with quorum devices in RHEL5
bz#237386
2007-04-23 14:55:28 +00:00
Milan Broz
0329281b49 Fix libdevmapper-event memory leaks 2007-04-19 19:10:19 +00:00
Patrick Caulfield
02c83d6edf Add some extra error checking & robustness.
Thanks to the Crosswalk engineering team:
    Leonard Maiorani
    Henry Harris
    Scott Cannata
2007-03-29 13:59:33 +00:00
Alasdair Kergon
c2784df48f Remove unnecessary memset() return value checks. [Jim Meyering] 2007-03-16 14:36:14 +00:00
Alasdair Kergon
112d09deb1 Improve dmeventd messaging protocol: drain pipe and tag messages. 2007-02-02 17:08:51 +00:00
Alasdair Kergon
aca043364e dmeventd mirror sets ignore_suspended_devices and avoids scanning mirrors. 2007-01-25 23:32:29 +00:00
Alasdair Kergon
2e1b92e3ea Add some missing close() and fclose() return code checks.
Fix exit statuses of reporting tools (2.02.19).
2007-01-25 14:37:48 +00:00
Alasdair Kergon
232da7ecc7 Add some missing close() and fclose() return value checks. 2007-01-25 14:16:20 +00:00
Alasdair Kergon
3329c69865 Add private variable to dmeventd shared library interface. 2007-01-23 17:40:40 +00:00
Alasdair Kergon
d28dfb5720 add a dso-private variable to dmeventd interface
more inline docn
2007-01-23 17:38:39 +00:00
Alasdair Kergon
f72de1dc1c Fix refresh_toolcontext() always to wipe persistent device filter cache.
Add is_long_lived to toolcontext.
2007-01-23 15:58:06 +00:00
Alasdair Kergon
4dcaa2300c Add dm_event_handler_[gs]et_timeout functions.
Streamline dm_report_field_* interface.
2007-01-22 15:03:57 +00:00
Alasdair Kergon
8a37910d51 register->monitor etc. 2007-01-19 22:21:45 +00:00
Alasdair Kergon
8bbec04d5b var dev_name->device_name (lvm2 has dev_name()) 2007-01-19 20:42:09 +00:00
Alasdair Kergon
919ab64fdb fix exit status; always print message on child failure 2007-01-19 18:08:36 +00:00
Alasdair Kergon
fcdf2e09a2 Add cmdline debug & version options to dmeventd.
Fix oom_adj handling.
2007-01-19 17:22:17 +00:00
Alasdair Kergon
c63c19a73e stat oom_adj and stay silent if it doesn't exist
dm_event_handler now keeps private copies of strings
2007-01-17 14:45:10 +00:00
Alasdair Kergon
5611829c89 more fixes 2007-01-16 23:03:13 +00:00
Alasdair Kergon
f6af1a67b5 more little fixes 2007-01-16 21:13:07 +00:00
Alasdair Kergon
74885e2203 clean up global mutex usage and fix a race in thread finalisation code
properly clean up thread status when thread terminates from within
2007-01-16 20:27:07 +00:00
Alasdair Kergon
e125e1547f dmeventd oom_adj + reduce thread stack size 2007-01-16 20:13:04 +00:00
Alasdair Kergon
61997bb9bb Add basic reporting functions to libdevmapper. 2007-01-16 18:04:15 +00:00
Alasdair Kergon
d5ec3c8889 reduce some if/else complexity 2007-01-15 22:37:40 +00:00
Alasdair Kergon
528329f199 Fix a malloc error path in dmsetup message. 2007-01-15 22:05:50 +00:00
Alasdair Kergon
6ae178f91c fix recent checkins 2007-01-15 19:47:49 +00:00
Alasdair Kergon
25f063d8b7 fail registration if timeout thread cannot be started 2007-01-15 19:19:31 +00:00
Alasdair Kergon
b2486b3d7d use DMEVENTD_PATH 2007-01-15 19:11:58 +00:00
Alasdair Kergon
c7a5306039 static naming 2007-01-15 18:58:40 +00:00
Alasdair Kergon
02059c81e7 Some libdevmapper-event interface changes. 2007-01-15 18:22:02 +00:00
Alasdair Kergon
931d24a4b1 More libdevmapper-event interface changes and fixes.
Rename dm_saprintf() to dm_asprintf().
2007-01-15 18:21:01 +00:00
Alasdair Kergon
8ef6eb30d9 Report dmeventd mirror monitoring status. 2007-01-12 20:38:30 +00:00
Alasdair Kergon
c8ee38201d Reinstate dm_event_get_registered_device 2007-01-12 20:22:11 +00:00
Alasdair Kergon
6b36e863cb updated dmeventd interface 2007-01-11 22:24:32 +00:00
Alasdair Kergon
3165248642 Lots of dmeventd-related changes. 2007-01-11 21:54:53 +00:00
Alasdair Kergon
7cc6c5d79a fail if status args are missing 2007-01-11 20:11:19 +00:00
Alasdair Kergon
65e635b685 Remove dmeventd mirror status line word limit 2007-01-11 19:52:06 +00:00
Alasdair Kergon
3b007b270d Use CFLAGS when linking so mixed sparc builds can supply -m64 2007-01-11 17:12:27 +00:00
Alasdair Kergon
4594807a24 Use CFLAGS when linking so mixed sparc builds can supply -m64. 2007-01-11 16:23:22 +00:00
Alasdair Kergon
616c3eccfd fix last checkin 2007-01-08 15:35:08 +00:00
Alasdair Kergon
5b95f17814 Lots of dmevent changes.
Export dm_basename().
Cope with a trailing space when comparing tables prior to possible reload.
2007-01-08 15:18:52 +00:00
Alasdair Kergon
6032a223f4 Add dmeventd_mirror register_mutex, tidy initialisation & add memlock. 2007-01-08 14:24:20 +00:00
Alasdair Kergon
0c8569edea Fix dmeventd mirror to cope if monitored device disappears. 2006-12-20 14:35:02 +00:00
Patrick Caulfield
e3e6eba1aa Fix gulm operation of clvmd. including a hang when attempting to
exclusively lock an LV that is already locked no another node.
2006-12-11 14:00:26 +00:00
Patrick Caulfield
47436a42df Fix hang in clvmd if a pre-command failed. The pre/post thread was getting
out of sync in this instance and would not quit.
2006-12-11 13:48:41 +00:00
Alasdair Kergon
a951e97ae9 clvmd ia64 alignment fixes etc. (pjc) 2006-12-01 23:10:26 +00:00
Alasdair Kergon
0357f18ef0 Fix VG clustered read locks to use PR not CR.
VG metadata reads were not being locked out during metadata updates.
2006-12-01 22:48:47 +00:00
Patrick Caulfield
a16f48e31a Always compile debug logging into clvmd as it's too useful to
restrict to just developers.
-d will switch it on and run the daemon in the foreground
2006-11-30 13:19:42 +00:00
Patrick Caulfield
bd8be78c09 Add -T (startup timeout) switch to clvmd 2006-11-30 09:44:07 +00:00
Jonathan Earl Brassow
56b7f2686e - likely cut and paste error. Fix wrong function name in debug
output.
2006-10-24 18:49:31 +00:00
Patrick Caulfield
efa483c599 Add clvmd call to return the cluster name. 2006-10-09 14:11:57 +00:00
Patrick Caulfield
44e0456766 Use strncpy rather than strcpy 2006-10-06 10:06:37 +00:00
Patrick Caulfield
e37a241536 Fix clvmd bug that could cause it to die when a node with a long name crashed. 2006-10-06 10:06:10 +00:00
Patrick Caulfield
2a7f7fc1c9 Vastly improve the errors returned to the user from clvmd.
It now captures the error messages that are generated and returns them
in the reply packet rather than just telling the user to check syslog.
2006-10-05 13:55:50 +00:00
Patrick Caulfield
13583874fc Add -R switch to clvmd.
This option will instruct all the clvmd daemons in the cluster to reload their device cache
2006-10-04 08:22:16 +00:00
Patrick Caulfield
b499b916ca Stop clvmd complaining about nodes that have left the cluster 2006-08-24 12:45:05 +00:00
Patrick Caulfield
8810d0811a Add needed new parameter to create_toolcontext(). 2006-08-22 09:49:20 +00:00
Alasdair Kergon
7d7736b7b4 Add dm_split_words() and dm_split_lvm_name() to libdevmapper. 2006-08-21 12:07:03 +00:00
Alasdair Kergon
f1dc5cc99b Add mutex to dmeventd_mirror to avoid concurrent execution. 2006-07-04 18:57:27 +00:00
Alasdair Kergon
2293567c8c Fix lvcreate corelog validation.
Add --config for overriding most config file settings from cmdline.
  Quote arguments when printing command line.
  Remove linefeed from 'initialising logging' message.
  Add 'Completed' debug message.
  Don't attempt library exit after reloading config files.
  Always compile with libdevmapper, even if device-mapper is disabled.
2006-05-16 16:48:31 +00:00
Patrick Caulfield
20b4c02b89 Add needed include. 2006-05-15 12:32:08 +00:00
Alasdair Kergon
366a68282f fix compile 2006-05-15 11:56:15 +00:00
Alasdair Kergon
3e3d5d8593 Add --monitor to vgcreate and lvcreate to control dmeventd registration.
Propagate --monitor around cluster.
Filter LCK_NONBLOCK in clvmd lock_vg.
2006-05-12 19:16:48 +00:00
Alasdair Kergon
aeb2c277a8 Add mirror log fault-handling policy. 2006-05-11 19:45:53 +00:00
Alasdair Kergon
2a99b5b816 Avoid a dmeventd compiler warning. 2006-05-11 19:08:02 +00:00
Alasdair Kergon
526a3c2186 Propagate nosync flag around cluster. 2006-05-11 19:05:21 +00:00
Alasdair Kergon
6657d5b66b Move DEFS into configure.h.
Remove dmsetup line buffer limitation.
2006-05-10 19:38:25 +00:00
Alasdair Kergon
72b2cb613a Make SIZE_SHORT the default for display_size().
Fix some memory leaks in error paths found by coverity.
Use C99 struct initialisers.
Move DEFS into configure.h.
Clean-ups to remove miscellaneous compiler warnings.
2006-05-09 21:23:51 +00:00
Alasdair Kergon
dfb5da937e tweak .so loading messages; extra device_exists() sanity check 2006-04-28 14:08:04 +00:00
Alasdair Kergon
b4cbeca164 fix makefile 2006-04-19 17:32:05 +00:00
Alasdair Kergon
126a5696f2 fix makefile 2006-04-19 17:24:00 +00:00
Alasdair Kergon
06541daa12 fix makefile 2006-04-19 17:15:08 +00:00
Alasdair Kergon
0c8ff3ad63 make pkgconfig installation step optional, and clean up generated files 2006-04-19 16:38:56 +00:00
Alasdair Kergon
8a2fc58645 Check for libsepol.
Add some cflow & scope support.
Separate out DEFS from CFLAGS.
Remove inlines and use unique function names.
2006-04-19 15:33:07 +00:00
Alasdair Kergon
d81e3d0bad configure/makefile tidying + pkg-config support. 2006-04-19 15:23:10 +00:00
Patrick Caulfield
a31676722b allow new cman to shutdown on request. 2006-03-21 10:31:08 +00:00
Patrick Caulfield
70ca1c94f1 Make sure it compiles if gulm is NOT selected AND using an old libcman.h 2006-03-15 08:36:11 +00:00
Patrick Caulfield
e7f55bb4c0 Get clvmd to use libcman rather than cman ioctl calls. This makes
it forward-compatible with the new userland CMAN in cluster head.

To build it you will need the libcman header & library installed.
2006-03-14 14:18:34 +00:00
Alasdair Kergon
9f5d8283a9 Propagate partial mode around cluster. 2006-03-09 22:34:13 +00:00
Alasdair Kergon
9ab7701215 dmeventd thread/fifo fixes. 2006-03-09 21:33:59 +00:00
Alasdair Kergon
ed2b1bc5eb post-release
fix dmeventd build
2006-02-08 23:23:19 +00:00
Alasdair Kergon
7ffe8aab61 remove a dmeventd_mirror syslog message 2006-02-06 19:34:45 +00:00
Alasdair Kergon
768255c061 fix tabs 2006-02-03 21:34:11 +00:00
Alasdair Kergon
a0d0eda9b3 tweak clvmd makefile 2006-02-03 21:31:00 +00:00
Alasdair Kergon
d8f0eeb039 Temporary device_exists() fixes. 2006-02-03 19:44:59 +00:00
Alasdair Kergon
4206c3db2e Use supplied full dso name. 2006-02-03 19:41:34 +00:00
Alasdair Kergon
93dc5190bc fix libdevmapper-event-mirror liblvm2cmd link search path 2006-02-03 14:48:38 +00:00
Alasdair Kergon
e4c11ad108 Only do lockfs filesystem sync when suspending snapshots.
Switchover library building to use LIB_SUFFIX.
2006-01-31 14:52:30 +00:00
Alasdair Kergon
5e3bd86778 Rename _log to dm_log and export.
Fix misc compile-time warnings.
2006-01-31 14:50:38 +00:00
Alasdair Kergon
db204c51a6 Tidy some comments/messages. 2006-01-27 20:52:21 +00:00
Alasdair Kergon
1ff0ef6945 Fix renamed dso. 2006-01-27 20:51:36 +00:00
Alasdair Kergon
6463fa2993 dmeventd thread termination fix 2006-01-27 20:50:01 +00:00
Alasdair Kergon
fc2b1f2ce9 some init_client cleanup 2006-01-27 20:49:13 +00:00
Alasdair Kergon
f0b4c52d4a More dmeventd mirror cleanups. 2006-01-27 20:48:19 +00:00
Alasdair Kergon
17840c21c3 Remove avoidable dmeventd mirror forking. 2006-01-27 20:47:20 +00:00
Alasdair Kergon
7000cdb5ea Fix libdevmapper event daemon_running status. 2006-01-27 20:46:06 +00:00
Alasdair Kergon
3bee15b0fb Replace deprecated signal functions. 2006-01-27 20:45:17 +00:00
Alasdair Kergon
cb49c5a03f Use split_dm_name in dmeventd mirror code. 2006-01-27 20:43:52 +00:00
Alasdair Kergon
132a76156e fix dmevent registration return codes 2006-01-27 20:01:45 +00:00
Alasdair Kergon
74892f5c3d read/write loop fixes 2005-12-19 22:56:47 +00:00
Alasdair Kergon
ce7ed2c0a9 Change dm_tree_node_add_mirror_target_log parm order 2005-12-19 21:03:17 +00:00
Alasdair Kergon
e66f1197d6 comments 2005-12-13 13:34:31 +00:00
Alasdair Kergon
3c588200fe Fix dmeventd build. 2005-12-05 11:16:48 +00:00
Alasdair Kergon
16da207de2 fix exports 2005-12-02 21:00:33 +00:00
Alasdair Kergon
06f62ad1e4 Add mirror dmeventd library 2005-12-02 19:52:06 +00:00
Alasdair Kergon
dd3ec4e87a dmeventd updates 2005-12-02 15:39:16 +00:00
Patrick Caulfield
47b59176e0 Make it compile with debug enabled. 2005-11-10 08:49:29 +00:00
Patrick Caulfield
c650c19805 Use hash functions in libdevmapper. 2005-11-09 09:24:10 +00:00
Alasdair Kergon
2262b32057 Use hash, bitset, malloc, pool from libdevmapper. 2005-10-16 23:03:59 +00:00
Patrick Caulfield
fe6c78629d clvmd no longer takes out locks for non-clusteed LVs,
and non-clustered LVs are only activated on the local node.
2005-08-16 08:25:09 +00:00
Alasdair Kergon
07d318310b Prepare tools to support clustered mirrors. 2005-08-14 23:18:28 +00:00
Patrick Caulfield
4bb7474e8a Don't send a signal to kill threads that are idling nicely as it upsets them.
This seems to cure bz#159727 on SMP systems.

Alasdair, can you include this patch in the lvm2-cluster package please ?
2005-08-09 10:39:57 +00:00
Benjamin Marzinski
7bfd1238ce Fixing some makesfiles, so that the correct things link against pthreads.
Also changed dmevent so that in no longer links against pthreads, and
dynamically loads libdmevent.so.  Everything seems to work just fine like this.
2005-06-14 19:06:26 +00:00
Patrick Caulfield
470b46cee1 Log an error if clvmd can't resolve a host name got from CCS
Fix potential spin loop in clvmd
2005-06-14 10:35:02 +00:00
Patrick Caulfield
5a3f4a794d Don't defer closing of FDs in clvmd as it can cause trouble. 2005-06-13 10:16:21 +00:00
Patrick Caulfield
eeee8cfd31 Be a bit smarter about reading stuff from the sockets 2005-06-10 09:11:01 +00:00
Benjamin Marzinski
5469414bf8 Timeout event implementation:
The daemon side of this is mostly the same as the patch I sent out.  To select
a timeout period different than the default and to get the timeout period,
I added two library calls, dm_set_event_timeout() and dm_get_event_timeout().
If people are against them, the other option is to tack extra arguments onto
dm_regiser_for_event() and dm_get_registered_device().  I also added a
-t option to dmevent, so people can try out timeouts.
2005-06-09 18:40:49 +00:00
AJ Lewis
8e6230ddd9 Change the multilog code to toggle between async and sync writes for all
log types.  This means the threaded_syslog type is no longer valid.  A new
fxn multilog_async is available to toggle between the two modes.  If an
app is compiled without pthreads and tries to use async logging, no logging
will occur while async is enabled.

dmeventd has been modified to use the new code

I'm not positive I like the way the async_logger code calls the log fxn,
but it works for now.  Suggestions for other ways to do it would be helpful
2005-05-25 21:08:36 +00:00
Heinz Mauelshagen
9e0419057c Exit after last unregister_for_event() 2005-05-20 13:53:26 +00:00
AJ Lewis
bca1803fea o Changed the multilog API a bit (I warned you)
- multilog_add_type, multilog_del_type, multilog_custom, and
     multilog_init_verbose all have different arguments.
   - Primary change is that caller only passes in config info, and the
     lib keeps track of state internally.  No more exporting of
     'struct log_data'.
   - Custom callers now only get the custom data pointer passed into their
     log fxn (that is set with multilog_custom)
   - Added basic README that describes libmultilog
2005-05-09 18:44:35 +00:00
Benjamin Marzinski
f60f128448 oops. Those are char **'s not char *'s 2005-05-04 19:24:03 +00:00
Benjamin Marzinski
cbac299f5b fixed dmevent so that it doesn't do a double free when you run
# dmevent -l

Also, changed the behaviour of dm_get_registered_device(), so that it doesn't
change the pointer you passed in without freeing the memory on a non-next call,
and doesn't free your pointer without setting it to NULL on a failed next call.
2005-05-04 18:53:28 +00:00
Heinz Mauelshagen
40773cd620 o libmultilog needs introducing of list locking in order to stand
multilog_add_type()/multilog_del_type cycles correctly.
o fixed segfault in multilog_add_type()
o fixed test-multilog.c
o cleaned up libmultilog (list macros, indentation, braces, comments)
2005-05-04 11:52:07 +00:00
Jonathan Earl Brassow
1862e88ffa - make noop use multilog
- add event_nr to thread_status struct and set appropriately so that the
  thread actually waits for an event
- essentially make error_detected return true.  Let the DSOs determine
  how to interpret the status info
2005-05-04 01:57:31 +00:00
AJ Lewis
cd4355d8f4 o stick multilog into the dm-event lib and dmeventd code again
o more tweaks to libmultilog calls - the api isn't set in stone yet, so
   don't get too comfortable.
 o not sure the dmeventd in device-mapper/dmeventd works - i've been using
   the one in lib/event/
 o currently both daemons are set to log only to syslog
2005-05-03 21:29:13 +00:00
Heinz Mauelshagen
1d76599a94 working dm_get_registered_device(). dmevent.c update to use it. 2005-05-03 16:15:20 +00:00
Heinz Mauelshagen
088e6e29da more dm_get_registered_device() code 2005-05-03 13:50:42 +00:00
Benjamin Marzinski
4396ee160a dmeventd was looking for dsos with libdmeventd<name>.so
The Makefile turned noop.c into    libdmeventnoop.so
The Makefile now turns noop.c into libdmeventdnoop.so
2005-05-02 19:34:25 +00:00
Benjamin Marzinski
64f4fd6e2b stopped printing a string after we erased the pointer to it. 2005-05-02 18:43:23 +00:00
Benjamin Marzinski
33c1c56800 removed the -lmultilog for now. 2005-05-02 18:42:07 +00:00
Benjamin Marzinski
1e8221b3ad get the makefile to clean up the .o's 2005-05-02 17:41:54 +00:00
Heinz Mauelshagen
c4763cf8c9 Introduce exit() in main() and cleanup signal settings for parent/child 2005-05-02 11:02:19 +00:00
Benjamin Marzinski
d4d51bd6d3 more variable initialization. 2005-04-29 22:12:09 +00:00
Heinz Mauelshagen
d54da54d67 o checking in instrumented code for AJ to follow up on comms and logging
o changed

  int dm_get_next_registered_device(char **dso_name, char **device,
                                    enum event_type *events);

  to

  int dm_get_registered_device(char **dso_name, char **device,
                               enum event_type *events, int next)

  so that the daemon is able to retrive the next one of the list without
  running into locking issues.

o changed dmevent.c to use dm_get_registered_device()

o couldn't test this yet because of the comms issues
  (daemon exits in do_process_request())
2005-04-29 14:56:35 +00:00
Heinz Mauelshagen
96c5c1f9ea first changes to get comms back to work after flock changes 2005-04-29 13:41:25 +00:00
Heinz Mauelshagen
b0e25eef22 minor cleanup 2005-04-29 10:58:34 +00:00
AJ Lewis
871e7fcd1a o Build dmeventd against multilog 2005-04-28 22:47:52 +00:00
Alasdair Kergon
db6c5ba5b2 build libdmeventnoop.so for testing 2005-04-28 17:32:27 +00:00
Alasdair Kergon
42712811e3 test.c->dmevent.c 2005-04-28 14:49:41 +00:00
Alasdair Kergon
e4fe47bc19 o adds dm_get_next_registered_device() (not functional yet)
to retrieve which devices got registered with the daemon;
  needs locking changes as well
2005-04-28 14:02:30 +00:00
Alasdair Kergon
b0c36cbd57 Prototype for a device-mapper event-handling daemon. 2005-04-27 22:32:00 +00:00
Patrick Caulfield
30bda7761e Tidy clvmd's SIGHUP handler so it doesn't do all that work. 2005-04-19 10:36:42 +00:00
Patrick Caulfield
2b7e4013cd Make clvmd work around some "limitations" in gulm's node state notifications.
Also make clvmd debuglog timestamps a little more helpful.
2005-04-13 13:50:07 +00:00
Patrick Caulfield
a478de3db6 set SO_KEEPALIVE on sockets 2005-04-01 16:03:00 +00:00
Patrick Caulfield
11270d07bf Don't allow user operations to start until the lvm thread is fully up.
Hopefully finally nails bz#146056
2005-04-01 13:01:01 +00:00
Alasdair Kergon
779b7713cf Tighten signal handlers. 2005-03-21 14:16:16 +00:00
Patrick Caulfield
a6c23d8b8b Don't take out the lvm_thread_lock at startup - it only protects the jobs list.
DEBUGLOG() message now print threadid rather than PID which is more useful.
2005-03-09 14:08:11 +00:00
Patrick Caulfield
3329bbfdf3 make clvmd FDs close-on-exec, to avoid warnings when running lvm via popen.
clvmd-gulm unlocks VG & orphan locks at startup in case they are stale.
clvmd-gulm now unlocks VG & orphan locks if client dies.
2005-03-07 17:03:44 +00:00
Patrick Caulfield
eb3037ddbd Fix clvmd-gulm node up/down code so it actually works.
clvmd-gulm now releases locks when shut down.
2005-02-22 16:26:21 +00:00
Patrick Caulfield
a00bfcc8b2 ./configure --enable-debug now enables debugging code in clvmd 2005-02-21 15:58:06 +00:00
Patrick Caulfield
ce1aa2c3ff Always manipulate both locks in sync_lock() otherwise they get left
hanging around and cause trouble.
2005-02-21 14:36:09 +00:00
Patrick Caulfield
c9808c329d Cope with more than one message arriving at the TCP socket, also
fix some instances where the length in the message was wrong (cman
code didn't notice this because it is packet-based comms anyway)
2005-02-18 15:31:32 +00:00
Patrick Caulfield
65c591696a Fix gulm->errno error number conversion. 2005-02-17 12:56:19 +00:00
Patrick Caulfield
a3dfa1c7d5 Make config check a little more tolerant of library names. 2005-02-14 09:07:14 +00:00
Patrick Caulfield
ceda2b1426 Fix thread shutdown race which could cause clvmd to hang in pthread_join. 2005-02-08 09:05:58 +00:00
Patrick Caulfield
5937664052 Revert last clvmd patch. More testing reveals that this just doesn't
work yet.
2005-02-07 14:45:38 +00:00
Patrick Caulfield
2cf7b80d8f Make clvmd use the command library rather than popen() to
preload the lock state.
2005-02-07 10:04:27 +00:00
Patrick Caulfield
d9656543ee Make clvmd do a quick sanity check on the clustering bits of lvm.conf 2005-02-02 11:42:29 +00:00
Patrick Caulfield
28b4320c7f Get rid of "connection refused" message because Corey doesn't like it. 2005-02-02 09:17:56 +00:00
Patrick Caulfield
9549da2743 Don't print CMAN error if initial probe fails - we could be running with GULM. 2005-01-26 09:30:52 +00:00
Patrick Caulfield
4e224cf079 Remove superflous &
Gulm clvmd no longer hangs trying to talk to a rebooted node.
2005-01-25 16:46:29 +00:00
Patrick Caulfield
c9f9a8b2b3 Make clvmd announce it's startup and cluster connection in syslog. 2005-01-24 15:31:13 +00:00
Patrick Caulfield
dbe0c8075e Get rid of libclvm as it's out-of-date and not used at all. 2005-01-21 11:56:30 +00:00
Patrick Caulfield
6f4d25ec7f Fix clvmd startup bug introduced in cman/gulm amalgamation. bz#145729
Improve reporting of node-specific locking errors so you'll get
somthing a little more helpfiul than "host is down" - it will now tell
you /which/ host it thinks is down.
2005-01-21 11:35:24 +00:00
Alasdair Kergon
5d0b9f475a fix clvmd lv_info_by_lvid open_count 2005-01-19 18:10:09 +00:00