Zdenek Kabelac
adc1fe4b3f
dmeventd: improved logged messages from thin plugin
...
Show better names in logged messages.
2016-07-04 17:40:24 +02:00
Zdenek Kabelac
2f638e07e8
dmeventd: thin plugin umount over 95%
...
Run umount code only when either thin data or metadata are
above 95% - so if there are resize failures with 60%.
system fill keep running.
Also umount will only be tried with lvm2 LVs.
Foreign users are ATM unsuppored.
2016-07-01 00:43:45 +02:00
Zdenek Kabelac
1be74cfd7f
cleanup: gcc warn about comparing int with uint
2016-04-12 11:47:51 +02:00
Alasdair G Kergon
1216efdf15
activate: Use macros for target and module names.
2016-03-22 17:46:15 +00:00
Zdenek Kabelac
2e168a52b0
coverity: drop unneeded header
2016-02-23 21:40:12 +01:00
Zdenek Kabelac
fcbef05aae
doc: change fsf address
...
Hmm rpmlint suggest fsf is using a different address these days,
so lets keep it up-to-date
2016-01-21 12:11:37 +01:00
Zdenek Kabelac
68e2ea11a3
mirror: fix condition
...
Recent patch tested wrong condition for error
2015-12-01 13:59:20 +01:00
Zdenek Kabelac
86e7894ecc
cleanup: use dm_get_status_mirror
...
Use libdm function to parse mirror status report.
2015-12-01 13:03:16 +01:00
Zdenek Kabelac
099466939e
thin: dmeventd plugin check number of failures
...
If plugin's lvm command execution fails too often (>10 times),
there is no point to torture system more then necessary, just log
and drop monitoring in this case.
2015-10-29 12:14:20 +01:00
Zdenek Kabelac
1a7bea0f0f
cleanup: drop debug
2015-10-23 10:54:13 +02:00
Zdenek Kabelac
1a2d0a0c72
cleanup: indents
2015-10-22 22:46:10 +02:00
Zdenek Kabelac
aeec62ad19
dmeventd: snapshot plugin unmonitor
...
Send signal to itself to mark plugin as 'finished' as
the watching rule is no longer usable.
2015-10-22 22:41:12 +02:00
Zdenek Kabelac
fa9e41d2e3
dmeventd: thin plugin update
...
Use dm_make_percent for percentage calculation like lvm2 command.
Use a single call for resize.
2015-10-22 22:33:07 +02:00
Zdenek Kabelac
6b0bc5b2d9
dmeventd: snapshot plugin device removal
...
Add #ifdef-ed code to have ability to even remove unusable device.
For now purely experimental.
2015-10-22 22:29:53 +02:00
Zdenek Kabelac
7ff5b03e5e
dmeventd: snapshot plugin updates
...
Improve test for invalid snapshot.
Use dm_make_percent() to manipulate with exactly same percentage
as lvm2 command is using.
2015-10-22 22:29:50 +02:00
Zdenek Kabelac
91350f5c6a
dmeventd: mirror plugin update
...
Don't use --config - this requires reload of lvm.conf
2015-10-22 22:28:37 +02:00
Zdenek Kabelac
9c5c9e2355
dmeventd: raid plugin reporting
...
Fix raid logging introduced with last updating commit.
2015-10-22 22:28:37 +02:00
Zdenek Kabelac
cde12cbe9e
dmeventd: lvm2 plugin correctly debug
...
Fix debug message and report exit when really doing it.
Also add missing '_' to static function.
2015-10-22 22:28:37 +02:00
Zdenek Kabelac
a6d1c8ac65
dmeventd: use matching function
...
Respect lvm2_log_fn prototype. The idea of 'reusing' print_log with
plain cast is causing very strange crashes with some older 'gcc' compilers.
So just do it cleanly...
2015-10-14 14:25:27 +02:00
Zdenek Kabelac
3f1a3b7090
dmeventd: fix missing '!'
...
During recent code changes '!' was badly converted.
2015-10-13 22:10:47 +02:00
Zdenek Kabelac
4b586ad3c2
dmeventd: rework raid plugin
...
Switch to per-thread mem-pool and lock only for lvm2 calls.
Use libdm parser for raid status line.
2015-10-13 16:02:19 +02:00
Zdenek Kabelac
256e432e78
dmeventd: less locking mirror
...
Rework mirror plugin to use per-thread mem-pool.
This allows to use locking only for lvm2 library calls.
2015-10-13 16:02:18 +02:00
Zdenek Kabelac
51ff7d5ed8
dmeventd: less locking for snapshot and thin
...
Use lvm lock for lvm library calls.
dm functions in-use are 'thread-safe' since we use
local per-thread mem pool.
2015-10-13 16:01:41 +02:00
Zdenek Kabelac
49e11102c7
dmeventd: add local mempool for raid and mirror
...
Using local mempools allows to drop locks when such memory is needed.
2015-10-13 15:56:23 +02:00
Zdenek Kabelac
a11cd2ca2d
dmeventd: use new macros to init mempool
...
For thin and snapshot use new macros
to simplify mempool init and destroy
2015-10-13 15:56:03 +02:00
Zdenek Kabelac
f9926e7e6c
dmeventd: introduce macro for init
...
Simplify commonly used pool creation.
2015-10-13 15:56:03 +02:00
Zdenek Kabelac
09a8479cb7
cleanup: move system defines before structs
2015-10-13 15:22:58 +02:00
Zdenek Kabelac
0a633750f1
cleanup: avoid using private
...
Switch private to user.
2015-10-13 15:22:58 +02:00
Zdenek Kabelac
e261af52eb
dmeventd: handle snapshot overflow
...
When snapshot reports overflow, handle it in the same way as Invalid.
Until better ideas are implemented.
2015-10-13 15:15:44 +02:00
Zdenek Kabelac
0e27210308
dmeventd: add more debug messages
2015-10-13 15:15:43 +02:00
Zdenek Kabelac
c90363b585
dmeventd: use log_ macros in plugins
...
Convert from syslog to standard log_() macros in plugins.
2015-10-13 15:09:03 +02:00
Zdenek Kabelac
915f0faac1
dmeventd: syslog -> log_xxxxx
...
Convert logging of dmeventd to libdm logging macros.
2015-10-13 14:43:30 +02:00
Zdenek Kabelac
2b9843c20b
dmeventd: reorder mempool allocation
...
Since lvm2_init() effectively detects memory leaks
allocate mempool after this initialization
(so it's not reported as leak).
2015-09-03 23:34:36 +02:00
Zdenek Kabelac
bff3a1651d
debug: use epoch for dmeventd logging
...
When LVM_LOG_FILE_EPOCH is set, route lvm command debug message
to lvm.conf log file instead of syslog.
2015-04-20 12:12:22 +02:00
Petr Rockai
eac4e1e939
dmeventd: Call lvscan --cache also for mirrors (in addition to RAID).
2015-01-14 18:05:44 +01:00
Petr Rockai
5dc6671bb5
dmeventd: Call lvscan --cache in the RAID plugin.
2014-07-22 22:48:21 +02:00
Zdenek Kabelac
6b701c3a48
cleanup: dmeventd abstract lvm2cmd interface
...
Keep lvm2cmd interface hidden inside dmeventd_lvm
and use regular 1/0 return codes, this we may
avoid using lvm2cmd.h in other lvm2 plugins.
2014-04-18 16:38:51 +02:00
Zdenek Kabelac
451a168bf8
cleanup: drop inclusion of devmap - merge
2014-04-18 16:38:50 +02:00
Zdenek Kabelac
589983a257
cleanup: include stdarg.h where needed.
...
Avoid dependency on implicit inclusion of stdarg.h with
libdevmapper.h.
2014-04-18 16:38:50 +02:00
Zdenek Kabelac
07274f3dd4
makefiles: drop linking of deamon libs to plugins
...
Daemon lib is linked into lvm2cmd library.
2014-04-18 16:38:49 +02:00
Zdenek Kabelac
0b6d6bfb77
thin: dmeventd plugins support more minors
...
Kernel supports upto 1M (20bit) minors.
TODO: convert to hash to reduce memory requirements
2014-04-18 16:38:47 +02:00
Alasdair G Kergon
527db4645f
gcc: replace #ifdef linux with __linux__
2013-11-13 13:56:29 +00:00
Jonathan Brassow
7de533ad12
mirror: Handle failures in tmp mirror used when up-converting.
...
Failures in the temporary mirror used when up-converting cause dmeventd
to issue 'lvconvert --repair' on the sub-LV, <lv_name>_mimagetmp_?. The
'lvconvert' command refuses to deal with this sub-LV outright - it
expects to be given the name of the top-level LV. So, just like we do
with mirrored logs, we strip-off the portion of the name that is not
the top-level LV and issue the command on the top-level LV instead.
2013-11-08 09:52:00 -06:00
Alasdair G Kergon
7c6526aae2
lvresize: separate validation from action
...
Start separating the validation from the action in the basic lvresize
code moved to the library.
Remove incorrect use of command line error codes from lvresize library
functions. Move errors.h to tools directory to reinforce this,
exporting public versions of the error codes in lvm2cmd.h for dmeventd
plugins to use.
2013-07-06 03:28:21 +01:00
Zdenek Kabelac
55f42944bd
dmeventd: revert back percent to int
...
int is perfectly ok here.
2013-05-30 16:46:58 +02:00
Zdenek Kabelac
e992cb253c
dmeventd: use dm_get_status_snapshot()
...
Switch to use libdm dm_get_status_snapshot() function for
reading status info.
This fixes bug, where the code was using 32bit integers,
while the snapshot target is able to return 64bit sizes.
However this also means, someone is using >1TB snapshot
cow devices, which is actually very bad idea anyway, since the
perfomance and memory usage in this case is very bad.
2013-05-27 10:33:06 +02:00
Zdenek Kabelac
810bc4f8c1
dmeventd: use dm_mountinfo_read
...
Reuse mountinfo reading code from libdm.
2013-05-20 16:47:33 +02:00
Zdenek Kabelac
a2b76a6f02
thin: fix resource leak in err path
...
If the devices list could not have been obtained, FILE* was leaked.
2013-04-21 23:10:30 +02:00
Zdenek Kabelac
6f9e26f5c0
thin: dmeventd fix memleak on error path
...
Some error paths on _umount have leaked bitset.
2012-12-15 17:23:27 +01:00
Zdenek Kabelac
3972bd98fb
thin: add support to unmount volumes
...
Reset counter after thin pool resize failure.
If the pool goes above threshold, support unmounting
of all thin volumes if the lvextend fails to avoid
overfilling of the pool.
2012-10-14 23:19:20 +02:00