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

337 Commits

Author SHA1 Message Date
Alasdair Kergon
ae1e83aa94 Attempt to build dmeventd.static. 2009-10-13 02:35:26 +00:00
Alasdair Kergon
902c4069dc More build cleanups (linker parameter ordering). 2009-10-13 01:31:10 +00:00
Alasdair Kergon
79aa89a62a Extra libs must be appended, not defined first. 2009-10-09 16:04:54 +00:00
Alasdair Kergon
437219e27d More makefile cleaning up and fixing. (gentoo) 2009-10-05 13:46:00 +00:00
Alasdair Kergon
db8b5af9d9 Allow for a build directory separate from the source. 2009-10-02 19:10:31 +00:00
Alasdair Kergon
cf8ee443e5 Fix dmeventd _temporary_log_fn parameters. (2.02.50) 2009-09-17 10:37:23 +00:00
Mikulas Patocka
3395d72881 Change exit() to _exit() in the child process. exit flushes stdio file buffers,
_exit doesn't. If there were some open files, an error in exec and subsequent
exit() would cause the buffers to be flushed twice.

Example:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>

int main()
{
	printf("buu");
	if (!fork()) {
		execl("/bin/true-not-exists", "/bin/true", NULL);
		exit(1);
	}
	wait(NULL);
	return 0;
}

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com

---
 daemons/dmeventd/libdevmapper-event.c |    2 +-
 lib/misc/lvm-exec.c                   |    2 +-
 test/harness.c                        |    3 ++-
 tools/dmsetup.c                       |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
2009-07-13 21:26:41 +00:00
Alasdair Kergon
476d463348 pre-release tidy up 2009-06-30 18:39:31 +00:00
Petr Rockai
1f164ad9d0 - Ignore suspended devices during repair (Milan).
- Call vgreduce --removemissing (without --force) automatically to clean up bad
  PVs (Milan).
2009-06-15 14:47:39 +00:00
Milan Broz
01fb9ca9a0 Do not fork daemon when dmeventd cannot be found. 2009-06-15 12:29:41 +00:00
Milan Broz
c26488d348 Use lvconvert --repair instead of vgreduce in mirror dmeventd DSO (mornfall)
Introduce lvconvert --use_policies (mornfall)
2009-06-04 12:01:15 +00:00
Alasdair Kergon
450928e304 Revert:
Use lvconvert --repair in dmeventd mirror DSO.
for now.

It replaces bad behaviour in one set of circumstances with bad behaviour
in a different set.  We think the behaviour needs to be more configurable.
2009-05-20 22:24:48 +00:00
Milan Broz
ac0034c20f Use lvconvert --repair in dmeventd DSO (mornfall)
This means two things:

1) Non-mirrored LVs will be no longer affected by mirror monitoring. (Before,
if you had a LV that went partially missing on a VG where a mirror leg failed,
this LV would be removed automatically by dmeventd... Probably not an
unrecoverable dataloss bug, but still quite unpleasant.)

2) If enough parallel PV space is available at the time of the mirror failure,
the failed devices will be automatically replaced using this spare space. Which
(and whether) free space may be used is still not configurable, but is a
planned feature. Since it is relatively easy to undo the action by converting
the mirror manually, I don't consider this to be a showstopper. In fact, I
think the compromise is much better than what we have now.
2009-05-19 10:25:16 +00:00
Milan Broz
0b502933c5 Introduce lvm2_install target.
Buildsystem support device-mapper only install,
but generic install tagret includes both dm+lvm2.

For distribution which uses separate install_device-mapper,
there is no way how to install lvm2 only
(so after installing lvm2 for packaging purposes
built system must remove installed device-mapper files).

Fix it by allowing lvm2_install target, similarily like
install_cluster for clvmd.

(install = install_device-mapper + install_lvm2)
2009-05-11 10:28:45 +00:00
Milan Broz
be82186cba Do not use generic install if running install_device-mapper.
It propagates into subdirs which includes DSOs which requires
lvm2 build (only install_device-mapper should propagate there).
2009-05-11 10:12:35 +00:00
Zdenek Kabelac
beeae21dbb Do not create some dm and lvm static librarie when they are not requested
by configure option
Add dependency for static dmeventd library
2009-04-08 14:04:35 +00:00
Alasdair Kergon
77b69aa724 make install_device-mapper 2008-11-04 17:25:32 +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
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
Milan Broz
550463b5e1 Fix mirror DSO to call vgreduce with proper parameters. 2008-09-25 15:52:29 +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
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
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
Petr Rockai
cd1a7e80c0 Fix a possible double-free in libdevmapper-event. 2007-11-27 12:26:06 +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
Alasdair Kergon
147d5faccf Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-21 16:26:07 +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
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
Alasdair Kergon
1bf5aae913 Change some #include lines to search only standard system directories. 2007-04-27 17:46:16 +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
Milan Broz
0329281b49 Fix libdevmapper-event memory leaks 2007-04-19 19:10:19 +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
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
4dcaa2300c Add dm_event_handler_[gs]et_timeout functions.
Streamline dm_report_field_* interface.
2007-01-22 15:03:57 +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
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
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
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
6657d5b66b Move DEFS into configure.h.
Remove dmsetup line buffer limitation.
2006-05-10 19:38:25 +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
d81e3d0bad configure/makefile tidying + pkg-config support. 2006-04-19 15:23:10 +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
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
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
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