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.
o streamlined timeout code
o put request handler functions onto a list because of the growing number
o avoided doing exit_timeout() work twice in timeout_thread()
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.
AJ Lewis [Wed, 25 May 2005 21:08:36 +0000 (21:08 +0000)]
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
AJ Lewis [Mon, 9 May 2005 18:44:35 +0000 (18:44 +0000)]
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
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.
AJ Lewis [Wed, 4 May 2005 17:55:12 +0000 (17:55 +0000)]
o Added a lib to handle locking - the multilog lib attempts to load it,
and if it fails because the binary wasn't compiled with pthread support
it just uses NOP locking. If it fails for any other reason, it fails
adding locking.
o added libmultilog_pthread_lock library that just does pthread mutex
locking
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)
- 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
AJ Lewis [Tue, 3 May 2005 21:29:13 +0000 (21:29 +0000)]
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
AJ Lewis [Mon, 2 May 2005 22:13:32 +0000 (22:13 +0000)]
o Moved the circular buffer code into a separate dynamic library
called libmultilog_async so that users of multilog aren't required to
use pthreads
o multilog now has a way to add logging types and remove types, and can be
called from other libraries.
o multiple logging types can be in place at a time, and they are all
called in turn when log_* fxns are called
o Currently, the 'standard' (stderr) logging type is registered if
multilog is called with no log types registered. I'm not sure that's
the best way to do things, but it's what I'm doing for now.
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
AJ Lewis [Thu, 28 Apr 2005 22:18:22 +0000 (22:18 +0000)]
o Initial draft of libmultilog - a logging library that, eventually, will
offer the same logging facilities as the logging in lvm2, plus a
non-blocking logging for syslog, plus anything else that people think it
needs. Currently only the non-blocking syslog logging is implemented.
o This library requires pthreads
- I expanded init_client() because of how the launching of the daemon
is now interlaced between opening of fifos.
- I eliminated create_fifo[s]() open_fifo[s]() _lock _unlock and maybe
some other functions.
- I have not completed the launching of the daemon. What I want is
to use 'fork()' but not 'exec()'. The child will call the daemon
function. The parent will wait for signal confirmation that the
daemon is ready or an exit (see CCS for how this is done).
- There is no more client side lock file.
- Clients are serialized so they will not be simultaneous daemon
launches or interleaved writes to the fifos.
AJ Lewis [Fri, 15 Oct 2004 16:56:36 +0000 (16:56 +0000)]
o patch refresh
- Adjust maintainership
- fix vcalloc call in dm-table.c
- Kevin Corry
- fix error cleanup in dm-exception-store.c:dm_create_persistent()
- Dave Olien
- proper error handling when someone is trying to read from multiple
regions.
- Kevin Corry