1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

11569 Commits

Author SHA1 Message Date
Peter Rajnoha
23d9b17a7b cleanup: typo in comment: compact_output_fields should be compact-output_cols 2015-10-19 09:59:05 +02:00
Peter Rajnoha
c3bfe07f2a config: add report/compact_output_cols to control which columns to compact in report output
The new report/compact_output_cols setting has exactly the same effect
as report/compact_output setting. The difference is that with the new
setting it's possible to define which cols should be compacted exactly
in contrast to all cols in case of report/compact_output.

In case both compact_output and compact_output_cols is enabled/set,
the compact_output prevails.

For example:

$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=0
compact_output_cols=""

$ lvs vg
  LV    VG   Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lvol0 vg   -wi-a----- 4.00m

---

$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=0
compact_output_cols="data_percent,metadata_percent,pool_lv,move_pv,origin"

$ lvs vg
  LV    VG   Attr       LSize Log Cpy%Sync Convert
  lvol0 vg   -wi-a----- 4.00m

---

$ lvmconfig --type full report/compact_output report/compact_output_cols
compact_output=1
compact_output_cols="data_percent,metadata_percent,pool_lv,move_pv,origin"

$ lvs vg
  LV    VG   Attr       LSize
  lvol0 vg   -wi-a----- 4.00m
2015-10-16 17:05:54 +02:00
Peter Rajnoha
508f0f5a21 libdm: add dm_report_compact_given_fields
dm_report_compact_given_fields is the same as dm_report_compact_fields,
but it processes only given fields, not all the fields in the report
like dm_report_compact_field does.
2015-10-16 17:05:54 +02:00
David Teigland
df34fcdafd lvmlockd: use flag to avoid blocking in sanlock_acquire
If a host failed while holding a sanlock lease,
sanlock_acquire will by default block and wait
for the lease to expire before returning.  We
want it to return with an error so we can retry
instead of blocking, which allows us to process
other lock operations.

(Enclose this in an ifdef until the new flag
appears in a sanlock release.)
2015-10-14 14:39:29 -05: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
7c36d7c90c thin: enforce local activation when creation new thin
As we need to check how full thin-pool is - require thin-pool is
locally active.
2015-10-14 01:00:35 +02:00
Zdenek Kabelac
bbef4edd06 makefiles: switch to rpath-link
Plain rpath is to invasive and gets into binary.
We only want to provide hint for linker.
2015-10-14 00:51:55 +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
a91fbe9d27 makefiles: older gcc needs hint with rpath
gcc 4.3 seems not to be able to find linked library without
specifying -rpath to linker  (plain -L) is not enough.
2015-10-13 22:02:17 +02:00
Zdenek Kabelac
ccc39be053 dmeventd: compilable without DEBUG CFLAG
Missed compilability without DEBUG.
2015-10-13 20:59:35 +02:00
Alasdair G Kergon
0cf787a377 Revert "log: no file for external logging"
This reverts commit 1b1c01a27b.

This caused messages to get dropped instead of logged into the log file.

(The log file and log function are independent at the moment.)
2015-10-13 15:31:57 +01:00
Zdenek Kabelac
acc70de439 tests: more extend testing 2015-10-13 16:02:21 +02:00
Zdenek Kabelac
cf1c2da836 tests: wait for initial sync
Raid should be in-sync ATM for any gaming.
2015-10-13 16:02:21 +02:00
Zdenek Kabelac
c4cc5eabfe tests: start logging dmeventd output
Log dmeventd output from test - keep output logging in test
and avoid sending messages to syslog.
2015-10-13 16:02:21 +02:00
Zdenek Kabelac
8cc21354c2 tests: better regex check
Enhance check for matching prefix.
2015-10-13 16:02:20 +02:00
Zdenek Kabelac
2cb1f6eafe tests: show status in in_sync
Make visible actual status line when returing 'raid' is in sync.
Useful to prove when kernel is wrong.
2015-10-13 16:02:20 +02:00
Zdenek Kabelac
9322918406 makefiles: src dirs have depth 5
For tags generation scan depth 5.
2015-10-13 16:02:20 +02:00
Zdenek Kabelac
83f00e9156 makefiles: drop explicit linking
Nothing in /sscripts needs devmapper-event library so drop its linking.
2015-10-13 16:02:20 +02:00
Zdenek Kabelac
4f9e7f692e makefiles: generate Local
Use same  exported symbols list for other generated symfile
as it appeared to be the right way for libdm.

Local {
	local:
		*;
};
2015-10-13 16:02:20 +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
76ea01dd20 dmeventd: new initialization of plugin threads
Rework thread creation code to better use resources.

New code will not leak 'timeout' registered thread on error path.

Also if the thread already exist - avoid creation of thread
object and it's later destruction.

If the race is noticed during adding new monitoring thread,
such thread is put on cleanup list and -EEXIST is reported.
2015-10-13 15:55:05 +02:00
Zdenek Kabelac
362558cd66 cleanup: typo in comment 2015-10-13 15:22:58 +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
0e2261dbd1 cleanup: remove multilog 2015-10-13 15:22:57 +02:00
Zdenek Kabelac
842a7a17e3 cleanup: always set nsec 2015-10-13 15:22:57 +02:00
Zdenek Kabelac
f4fb97c850 cleanup: more readable code 2015-10-13 15:22:57 +02:00
Zdenek Kabelac
8b9533f38f dmeventd: support logging on stdout
Add new supported option '-l' log to stdout/stderr.

It has to be paired with '-f' (foreground run).
2015-10-13 15:22:57 +02:00
Zdenek Kabelac
903e9af1b2 cleanup: static with _
Document ? is printing to stderr.
2015-10-13 15:16:56 +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
3f03d46fc1 man: dmeventd update 2015-10-13 15:15:43 +02:00
Zdenek Kabelac
0e27210308 dmeventd: add more debug messages 2015-10-13 15:15:43 +02:00
Zdenek Kabelac
13086c2523 dmeventd: drop changing logging
As we now use 'unified' logging macro system - we no longer need
to protect from change of logging function pointer - it's set
once at the start of dmeventd and not change anymore
(as lvm2 library no longer interferers here).
2015-10-13 15:15:43 +02:00
Zdenek Kabelac
42a9c8b4a6 dmeventd: enable new logging 2015-10-13 15:13:28 +02:00
Zdenek Kabelac
e50583d721 dmeventd: enable new logging 2015-10-13 15:09:35 +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
0641e3a5fd libdmevent: add dm_event_log
Add dm_event_log() logging function.
Controled by dm_event_log_set().
2015-10-13 14:40:46 +02:00
Zdenek Kabelac
11a084cf42 dmeventd: log all commands with CMD: prefix
For easier grep of all processed command - add CMD: prefix to them.

Use  >>>  for entring command processing
and  <<<  when command is processed.
2015-10-13 14:40:46 +02:00
Zdenek Kabelac
d60794c3a3 dmeventd: fix loging report
msg.cmd holds return value from processing after _do_process_request,
so save it before call.
2015-10-13 14:40:46 +02:00
Zdenek Kabelac
1b1c01a27b log: no file for external logging
When external logging is set do not bother creating log file,
as it's not going to be used.
2015-10-13 14:40:44 +02:00
Zdenek Kabelac
72d700b064 toolcontext: do not change already set dm_log
If the dm_log is already set to non-default logger,
avoid to change it.
2015-10-13 14:39:37 +02:00
Zdenek Kabelac
86b04ebd19 thin: enhance logging
Add debug message with more details about threshold overflow.
2015-10-13 14:38:52 +02:00
Zdenek Kabelac
7e1c08bb6a dmeventd: correct ret code for fail
As  _do_register_device() calls  register_device() function that returns
1 success & 0 fail -  ret = -ENOMEM for fail case instead of 0.
2015-10-13 14:38:49 +02:00
Zdenek Kabelac
c7b4359ff4 thin: check for overflown pool earlier
Check for pool early before we actually start to modify metadata.
This requires locally active thin-pool.
2015-10-13 14:37:07 +02:00