]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agocleanup: use enums
Zdenek Kabelac [Wed, 21 Oct 2015 18:56:20 +0000 (20:56 +0200)]
cleanup: use enums

9 years agodmeventd: code mode _get_device_status
Zdenek Kabelac [Thu, 22 Oct 2015 10:36:25 +0000 (12:36 +0200)]
dmeventd: code mode _get_device_status

Move _get_device_status() in code.
Use dm_task_no_flush() function when reading status.
(e.g. none blocking for thins pool)

9 years agodmeventd: minimize locking time for get_imeout
Zdenek Kabelac [Thu, 22 Oct 2015 10:38:26 +0000 (12:38 +0200)]
dmeventd: minimize locking time for get_imeout

Don't hold lock when creating message (allocating memory).
Thread cannot dissapear as it's only the same thread which
may clean it.

9 years agodmeventd: drop unneded test
Zdenek Kabelac [Thu, 22 Oct 2015 10:31:45 +0000 (12:31 +0200)]
dmeventd: drop unneded test

Function is never called without device.uuid.

9 years agodmeventd: wake up timer when setting new timeout
Zdenek Kabelac [Thu, 22 Oct 2015 10:37:18 +0000 (12:37 +0200)]
dmeventd: wake up timer when setting new timeout

9 years agodmeventd: use dm_hold_control_dev
Zdenek Kabelac [Wed, 21 Oct 2015 18:52:29 +0000 (20:52 +0200)]
dmeventd: use dm_hold_control_dev

Need here to keep  control device opened while there is 'any' dso
plugin loaded - otherwise there would a race closing controlfd
inside lvm2 plugin while some other monitoring thread would
tried to execute another WAITEVENT task.

9 years agodmeventd: move dso handling into single code section
Zdenek Kabelac [Thu, 22 Oct 2015 10:22:55 +0000 (12:22 +0200)]
dmeventd: move dso handling into single code section

Move all DSO related function in front, so they could be easily
referenced from rest of code.

Add proper error paths with logging and error reporting.

Drop mutex locking when releasing DSO - since DSO is always
allocated and released in main 'event' processing thread.

9 years agodmeventd: using warning level
Zdenek Kabelac [Thu, 22 Oct 2015 09:14:12 +0000 (11:14 +0200)]
dmeventd: using warning level

When dmevend notices problems, but continues to operate normally
change log level to warning.

9 years agodmeventd: no registering of 0 event mask
Zdenek Kabelac [Thu, 22 Oct 2015 09:10:57 +0000 (11:10 +0200)]
dmeventd: no registering of 0 event mask

Whenever user tries to register 0 mask report this as EINVAL.

9 years agodmeventd: thin plugin update
Zdenek Kabelac [Tue, 20 Oct 2015 12:19:35 +0000 (14:19 +0200)]
dmeventd: thin plugin update

Use  dm_make_percent for percentage calculation like lvm2 command.

Use a single call for resize.

9 years agodmeventd: snapshot plugin device removal
Zdenek Kabelac [Thu, 22 Oct 2015 13:38:24 +0000 (15:38 +0200)]
dmeventd: snapshot plugin device removal

Add #ifdef-ed code to have ability to even remove unusable device.
For now purely experimental.

9 years agodmeventd: snapshot plugin updates
Zdenek Kabelac [Thu, 22 Oct 2015 13:35:55 +0000 (15:35 +0200)]
dmeventd: snapshot plugin updates

Improve test for invalid snapshot.

Use dm_make_percent() to manipulate with exactly same percentage
as lvm2 command is using.

9 years agodmeventd: mirror plugin update
Zdenek Kabelac [Thu, 22 Oct 2015 15:09:43 +0000 (17:09 +0200)]
dmeventd: mirror plugin update

Don't use  --config  - this requires reload of lvm.conf

9 years agodmeventd: raid plugin reporting
Zdenek Kabelac [Thu, 22 Oct 2015 08:38:40 +0000 (10:38 +0200)]
dmeventd: raid plugin reporting

Fix raid logging introduced with last updating commit.

9 years agodmeventd: lvm2 plugin correctly debug
Zdenek Kabelac [Thu, 22 Oct 2015 08:38:05 +0000 (10:38 +0200)]
dmeventd: lvm2 plugin correctly debug

Fix debug message and report exit when really doing it.
Also add missing '_' to static function.

9 years agodmeventd: check for malloc return
Zdenek Kabelac [Mon, 19 Oct 2015 08:59:09 +0000 (10:59 +0200)]
dmeventd: check for malloc return

9 years agolibdm: add dm_hold_control_dev
Zdenek Kabelac [Wed, 21 Oct 2015 18:36:15 +0000 (20:36 +0200)]
libdm: add dm_hold_control_dev

Support hold of control device open.
Useful for daemons so the control device is not frequently reopenned.

9 years agotools: do not change signals for memlocked daemons
Zdenek Kabelac [Thu, 22 Oct 2015 08:45:58 +0000 (10:45 +0200)]
tools: do not change signals for memlocked daemons

9 years agotools: preselect some setting for memlocked daemons
Zdenek Kabelac [Thu, 22 Oct 2015 08:44:38 +0000 (10:44 +0200)]
tools: preselect some setting for memlocked daemons

When our daemon is locked into memory - avoid
communication with dmeventd and also skip
suspended devices.

9 years agomemlock: report memlock daemon counter
Zdenek Kabelac [Thu, 22 Oct 2015 08:43:58 +0000 (10:43 +0200)]
memlock: report memlock daemon counter

Add internal memlock_count_daemon().

Function can be used to recognize it's being executed
from daemon restricted execution inside /lib code.

9 years agolib: better reporting of threshold
Zdenek Kabelac [Thu, 22 Oct 2015 08:46:39 +0000 (10:46 +0200)]
lib: better reporting of threshold

Simplify code reporting warning about incorrect thresholds.

9 years agoman: document possible lvmetad -l values
David Teigland [Wed, 21 Oct 2015 18:36:57 +0000 (13:36 -0500)]
man: document possible lvmetad -l values

In the man page and the lvmetad help output.

9 years agolibdaemon: fix typo in last log enable commit
David Teigland [Wed, 21 Oct 2015 16:22:22 +0000 (11:22 -0500)]
libdaemon: fix typo in last log enable commit

9 years agolibdaemon: allow all debug levels for stderr
David Teigland [Wed, 21 Oct 2015 16:16:59 +0000 (11:16 -0500)]
libdaemon: allow all debug levels for stderr

The parsing code for log levels was missing
some levels.  Also ignore an unrecognized
level name rather than failing.

9 years agotests: add lvmetad shutdown on idle test
Ondrej Kozina [Tue, 20 Oct 2015 13:41:42 +0000 (15:41 +0200)]
tests: add lvmetad shutdown on idle test

9 years agolvmetad.8.in: update man page with timeout info
Ondrej Kozina [Tue, 20 Oct 2015 11:33:29 +0000 (13:33 +0200)]
lvmetad.8.in: update man page with timeout info

9 years agolvmetad: add optional timeout option
Ondrej Kozina [Tue, 20 Oct 2015 11:24:50 +0000 (13:24 +0200)]
lvmetad: add optional timeout option

9 years agotests: add test for missing mirror in-sync info
Ondrej Kozina [Tue, 20 Oct 2015 09:55:51 +0000 (11:55 +0200)]
tests: add test for missing mirror in-sync info

9 years agopolldaemon: fix missing mirror in-sync info with lvmpolld
Ondrej Kozina [Mon, 19 Oct 2015 14:56:45 +0000 (16:56 +0200)]
polldaemon: fix missing mirror in-sync info with lvmpolld

CONVERTING status flag is a tricky one. It's not set when converting
a non-mirror LV type to the mirror type, i.e.: linear -> two leg mirror.
Also the conversion itself is instant and doesn't require to be polled.
When mirror reaches sync state there's no final update on VG metadata
for lvmpolld to be made thereby report_progress in fact doesn't report
percentage of mirror being converted but percentage of mirror
being in sync. Perhaps we should reword the lvconvert output here.

On the other hand CONVERTING is set while we upconvert the mirror
from i.e. two leg mirror to four leg mirror. In such case the operation
is required to be polled so that lvmpolld can cleanup temporary
conversion log when the conversion is over.

Ignore CONVERTING lv_type for the moment and match LVs only by uuids
during 'mirror conversion'/'waiting for a sync to finish'.

9 years agoconf: clarify compact output settings
Peter Rajnoha [Tue, 20 Oct 2015 09:01:09 +0000 (11:01 +0200)]
conf: clarify compact output settings

9 years agopvscan: use process_each_pv
David Teigland [Mon, 19 Oct 2015 18:58:43 +0000 (13:58 -0500)]
pvscan: use process_each_pv

The old code made two loops through the PVs: in the first
loop it found the max PV and VG name lengths, and in the
second loop it printed each PV using the name lengths as
field widths for aligning columns.

The new code uses process_each_pv() which makes one loop
through the PVs.  In the *first* call to pvscan_single(),
the max name lengths are found by looping through the
lvmcache entries which have been populated by the generic
process_each code prior to calling any _single functions.
Subsequent calls to pvscan_single() reuse the max lengths
that were found by the first call.

9 years agoconf: regenerate
Peter Rajnoha [Mon, 19 Oct 2015 08:01:14 +0000 (10:01 +0200)]
conf: regenerate

9 years agocleanup: typo in comment: compact_output_fields should be compact-output_cols
Peter Rajnoha [Mon, 19 Oct 2015 07:59:05 +0000 (09:59 +0200)]
cleanup: typo in comment: compact_output_fields should be compact-output_cols

9 years agoconfig: add report/compact_output_cols to control which columns to compact in report...
Peter Rajnoha [Fri, 16 Oct 2015 14:25:51 +0000 (16:25 +0200)]
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

9 years agolibdm: add dm_report_compact_given_fields
Peter Rajnoha [Fri, 16 Oct 2015 13:50:13 +0000 (15:50 +0200)]
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.

9 years agolvmlockd: use flag to avoid blocking in sanlock_acquire
David Teigland [Wed, 14 Oct 2015 19:36:46 +0000 (14:36 -0500)]
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.)

9 years agodmeventd: use matching function
Zdenek Kabelac [Wed, 14 Oct 2015 12:19:47 +0000 (14:19 +0200)]
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...

9 years agothin: enforce local activation when creation new thin
Zdenek Kabelac [Tue, 13 Oct 2015 23:00:35 +0000 (01:00 +0200)]
thin: enforce local activation when creation new thin

As we need to check how full thin-pool is - require thin-pool is
locally active.

9 years agomakefiles: switch to rpath-link
Zdenek Kabelac [Tue, 13 Oct 2015 22:51:55 +0000 (00:51 +0200)]
makefiles: switch to rpath-link

Plain rpath is to invasive and gets into binary.
We only want to provide hint for linker.

9 years agodmeventd: fix missing '!'
Zdenek Kabelac [Tue, 13 Oct 2015 20:10:47 +0000 (22:10 +0200)]
dmeventd: fix missing '!'

During recent code changes '!' was badly converted.

9 years agomakefiles: older gcc needs hint with rpath
Zdenek Kabelac [Tue, 13 Oct 2015 20:02:17 +0000 (22:02 +0200)]
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.

9 years agodmeventd: compilable without DEBUG CFLAG
Zdenek Kabelac [Tue, 13 Oct 2015 18:57:59 +0000 (20:57 +0200)]
dmeventd: compilable without DEBUG CFLAG

Missed compilability without DEBUG.

9 years agoRevert "log: no file for external logging"
Alasdair G Kergon [Tue, 13 Oct 2015 14:31:57 +0000 (15:31 +0100)]
Revert "log: no file for external logging"

This reverts commit 1b1c01a27b359f8e91c3c9e08684c435d8fd51c2.

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

(The log file and log function are independent at the moment.)

9 years agotests: more extend testing
Zdenek Kabelac [Tue, 13 Oct 2015 12:33:24 +0000 (14:33 +0200)]
tests: more extend testing

9 years agotests: wait for initial sync
Zdenek Kabelac [Tue, 13 Oct 2015 09:21:40 +0000 (11:21 +0200)]
tests: wait for initial sync

Raid should be in-sync ATM for any gaming.

9 years agotests: start logging dmeventd output
Zdenek Kabelac [Tue, 13 Oct 2015 07:44:08 +0000 (09:44 +0200)]
tests: start logging dmeventd output

Log dmeventd output from test - keep output logging in test
and avoid sending messages to syslog.

9 years agotests: better regex check
Zdenek Kabelac [Fri, 9 Oct 2015 19:30:37 +0000 (21:30 +0200)]
tests: better regex check

Enhance check for matching prefix.

9 years agotests: show status in in_sync
Zdenek Kabelac [Wed, 7 Oct 2015 13:07:15 +0000 (15:07 +0200)]
tests: show status in in_sync

Make visible actual status line when returing 'raid' is in sync.
Useful to prove when kernel is wrong.

9 years agomakefiles: src dirs have depth 5
Zdenek Kabelac [Sun, 11 Oct 2015 22:10:37 +0000 (00:10 +0200)]
makefiles: src dirs have depth 5

For tags generation scan depth 5.

9 years agomakefiles: drop explicit linking
Zdenek Kabelac [Fri, 9 Oct 2015 19:33:59 +0000 (21:33 +0200)]
makefiles: drop explicit linking

Nothing in /sscripts needs devmapper-event library so drop its linking.

9 years agomakefiles: generate Local
Zdenek Kabelac [Fri, 9 Oct 2015 19:31:41 +0000 (21:31 +0200)]
makefiles: generate Local

Use same  exported symbols list for other generated symfile
as it appeared to be the right way for libdm.

Local {
local:
*;
};

9 years agodmeventd: rework raid plugin
Zdenek Kabelac [Tue, 13 Oct 2015 09:37:14 +0000 (11:37 +0200)]
dmeventd: rework raid plugin

Switch to per-thread mem-pool and lock only for lvm2 calls.
Use libdm parser for raid status line.

9 years agodmeventd: less locking mirror
Zdenek Kabelac [Tue, 13 Oct 2015 09:35:44 +0000 (11:35 +0200)]
dmeventd: less locking mirror

Rework mirror plugin to use per-thread mem-pool.
This allows to use locking only for lvm2 library calls.

9 years agodmeventd: less locking for snapshot and thin
Zdenek Kabelac [Tue, 13 Oct 2015 09:35:03 +0000 (11:35 +0200)]
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.

9 years agodmeventd: add local mempool for raid and mirror
Zdenek Kabelac [Tue, 13 Oct 2015 09:28:57 +0000 (11:28 +0200)]
dmeventd: add local mempool for raid and mirror

Using local mempools allows to drop locks when such memory is needed.

9 years agodmeventd: use new macros to init mempool
Zdenek Kabelac [Tue, 13 Oct 2015 09:30:37 +0000 (11:30 +0200)]
dmeventd: use new macros to init mempool

For thin and snapshot use new macros
to simplify mempool init and destroy

9 years agodmeventd: introduce macro for init
Zdenek Kabelac [Mon, 12 Oct 2015 09:37:36 +0000 (11:37 +0200)]
dmeventd: introduce macro for init

Simplify commonly used pool creation.

9 years agodmeventd: new initialization of plugin threads
Zdenek Kabelac [Tue, 13 Oct 2015 07:43:09 +0000 (09:43 +0200)]
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.

9 years agocleanup: typo in comment
Zdenek Kabelac [Mon, 12 Oct 2015 09:37:04 +0000 (11:37 +0200)]
cleanup: typo in comment

9 years agocleanup: move system defines before structs
Zdenek Kabelac [Mon, 12 Oct 2015 09:35:33 +0000 (11:35 +0200)]
cleanup: move system defines before structs

9 years agocleanup: avoid using private
Zdenek Kabelac [Mon, 12 Oct 2015 09:40:51 +0000 (11:40 +0200)]
cleanup: avoid using private

Switch private to user.

9 years agocleanup: remove multilog
Zdenek Kabelac [Tue, 13 Oct 2015 07:40:39 +0000 (09:40 +0200)]
cleanup: remove multilog

9 years agocleanup: always set nsec
Zdenek Kabelac [Tue, 13 Oct 2015 07:39:18 +0000 (09:39 +0200)]
cleanup: always set nsec

9 years agocleanup: more readable code
Zdenek Kabelac [Fri, 9 Oct 2015 19:37:12 +0000 (21:37 +0200)]
cleanup: more readable code

9 years agodmeventd: support logging on stdout
Zdenek Kabelac [Tue, 13 Oct 2015 13:14:11 +0000 (15:14 +0200)]
dmeventd: support logging on stdout

Add new supported option '-l' log to stdout/stderr.

It has to be paired with '-f' (foreground run).

9 years agocleanup: static with _
Zdenek Kabelac [Thu, 8 Oct 2015 09:59:11 +0000 (11:59 +0200)]
cleanup: static with _

Document ? is printing to stderr.

9 years agodmeventd: handle snapshot overflow
Zdenek Kabelac [Fri, 9 Oct 2015 19:41:50 +0000 (21:41 +0200)]
dmeventd: handle snapshot overflow

When snapshot reports overflow, handle it in the same way as Invalid.
Until better ideas are implemented.

9 years agoman: dmeventd update
Zdenek Kabelac [Mon, 12 Oct 2015 09:35:53 +0000 (11:35 +0200)]
man: dmeventd update

9 years agodmeventd: add more debug messages
Zdenek Kabelac [Sat, 10 Oct 2015 14:36:18 +0000 (16:36 +0200)]
dmeventd: add more debug messages

9 years agodmeventd: drop changing logging
Zdenek Kabelac [Fri, 9 Oct 2015 20:08:01 +0000 (22:08 +0200)]
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).

9 years agodmeventd: enable new logging
Zdenek Kabelac [Tue, 13 Oct 2015 13:13:28 +0000 (15:13 +0200)]
dmeventd: enable new logging

9 years agodmeventd: enable new logging
Zdenek Kabelac [Sat, 10 Oct 2015 16:32:53 +0000 (18:32 +0200)]
dmeventd: enable new logging

9 years agodmeventd: use log_ macros in plugins
Zdenek Kabelac [Sat, 10 Oct 2015 14:58:31 +0000 (16:58 +0200)]
dmeventd: use log_ macros in plugins

Convert from syslog to standard log_() macros in plugins.

9 years agodmeventd: syslog -> log_xxxxx
Zdenek Kabelac [Fri, 9 Oct 2015 19:57:48 +0000 (21:57 +0200)]
dmeventd: syslog -> log_xxxxx

Convert logging of dmeventd to libdm logging macros.

9 years agolibdmevent: add dm_event_log
Zdenek Kabelac [Sat, 10 Oct 2015 14:40:52 +0000 (16:40 +0200)]
libdmevent: add dm_event_log

Add dm_event_log() logging function.
Controled by dm_event_log_set().

9 years agodmeventd: log all commands with CMD: prefix
Zdenek Kabelac [Tue, 13 Oct 2015 09:19:59 +0000 (11:19 +0200)]
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.

9 years agodmeventd: fix loging report
Zdenek Kabelac [Fri, 9 Oct 2015 20:16:33 +0000 (22:16 +0200)]
dmeventd: fix loging report

msg.cmd holds return value from processing after _do_process_request,
so save it before call.

9 years agolog: no file for external logging
Zdenek Kabelac [Tue, 13 Oct 2015 07:44:33 +0000 (09:44 +0200)]
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.

9 years agotoolcontext: do not change already set dm_log
Zdenek Kabelac [Fri, 9 Oct 2015 19:38:50 +0000 (21:38 +0200)]
toolcontext: do not change already set dm_log

If the dm_log is already set to non-default logger,
avoid to change it.

9 years agothin: enhance logging
Zdenek Kabelac [Fri, 9 Oct 2015 19:35:05 +0000 (21:35 +0200)]
thin: enhance logging

Add debug message with more details about threshold overflow.

9 years agodmeventd: correct ret code for fail
Zdenek Kabelac [Tue, 13 Oct 2015 07:49:59 +0000 (09:49 +0200)]
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.

9 years agothin: check for overflown pool earlier
Zdenek Kabelac [Wed, 7 Oct 2015 13:10:03 +0000 (15:10 +0200)]
thin: check for overflown pool earlier

Check for pool early before we actually start to modify metadata.
This requires locally active thin-pool.

9 years agolibdm: enforce writethrough mode for cleaner
Zdenek Kabelac [Tue, 13 Oct 2015 12:06:15 +0000 (14:06 +0200)]
libdm: enforce writethrough mode for cleaner

With "cleaner" policy always use 'writethrough' mode.

9 years agowiping: make libblkid detect all copies of the same signature if use_blkid_wiping=1
Peter Rajnoha [Tue, 13 Oct 2015 10:18:04 +0000 (12:18 +0200)]
wiping: make libblkid detect all copies of the same signature if use_blkid_wiping=1

Some signatures are spread around the disk in several copies, mainly for
backup. Make libblkid to detect these extra copies - there was missing
"blkid_probe_step_back" fn call after successful wipe of previous signature
copy.

An example with FAT table which has copies:

$ mkfs.vfat /dev/sda1

Before this patch:

$ pvcreate /dev/sda1
WARNING: vfat signature detected on /dev/sda1 at offset 54. Wipe it? [y/n]: y
  Wiping vfat signature on /dev/sda1.
  Physical volume "/dev/sda1" successfully created

With this patch applied:

$ pvcreate /dev/sda1
WARNING: vfat signature detected on /dev/sda1 at offset 54. Wipe it? [y/n]: y
  Wiping vfat signature on /dev/sda1.
WARNING: vfat signature detected on /dev/sda1 at offset 0. Wipe it? [y/n]: y
  Wiping vfat signature on /dev/sda1.
WARNING: vfat signature detected on /dev/sda1 at offset 510. Wipe it? [y/n]: y
  Wiping vfat signature on /dev/sda1.
  Physical volume "/dev/sda1" successfully created

9 years agotests: test vgimportclone and -n option
Peter Rajnoha [Mon, 12 Oct 2015 10:54:35 +0000 (12:54 +0200)]
tests: test vgimportclone and -n option

9 years agovgimportclone: make sure there's no prefix in VG name list
Peter Rajnoha [Mon, 12 Oct 2015 10:51:13 +0000 (12:51 +0200)]
vgimportclone: make sure there's no prefix in VG name list

Make sure log/prefix is set to "" when getting the list of VG names.
We need this for the format to be correct so it's properly searched
through later on.

9 years agovgimportclone: fix vgimportclone with -n to not add number unnecessarily to base...
Peter Rajnoha [Mon, 12 Oct 2015 09:11:34 +0000 (11:11 +0200)]
vgimportclone: fix vgimportclone with -n to not add number unnecessarily to base VG name

$ vgcreate vgA /dev/sda
  Volume group "vgA" successfully created

$ dd if=/dev/sda of=/dev/sdb bs=1M
$ dd if=/dev/sda of=/dev/sdc bs=1M

(the new VG name is prefix of existing VG name)
$ vgimportclone -n vg /dev/sdb

(the new VG name is suffix of existing VG name)
$ vgimportclone -n gA /dev/sdc

Before this patch:
------------------
(we end up with "vg1" and "gA1" names with the "1" suffix which is not needed)
$ vgs -o vg_name
  VG
  gA1
  vg1
  vgA

With this patch applied:
------------------------
(we end up with "vg" and "gA" names as they're unique already and no extra suffix is added)
$ # vgs -o vg_name
  VG
  gA
  vg
  vgA

Of course, if the name supplied is not unique, the number is added correctly:
$ dd if=/dev/sda of=/dev/sdb bs=1M
$ vgimportclone -n vgA /dev/sdb
$ vgs -o vg_name
  VG
  vgA
  vgA1

9 years agoFix segfault when lvmlockd is running but not lvmetad
David Teigland [Fri, 9 Oct 2015 17:20:22 +0000 (12:20 -0500)]
Fix segfault when lvmlockd is running but not lvmetad

If lvmlockd is running, lvmetad is configured (use_lvmetad=1),
but lvmetad is not running, then commands will seg fault
when trying to send a message to lvmetad.

The difference is lvmetad being "active", not just "used".

9 years agovgimportclone: cleanup the script and remove dependency on awk, grep, cut and tr
Peter Rajnoha [Fri, 9 Oct 2015 14:26:27 +0000 (16:26 +0200)]
vgimportclone: cleanup the script and remove dependency on awk, grep, cut and tr

We can replace the expressions with awk/grep/cut/tr with --select now and
more suitable reporting options and modes. Also, we don't need to check
the temporary lvm.conf generated within vgimportclone script since we're
generating it ourselves now using lvmconfig, not using sed anymore like
it was before (so we can be pretty sure it's correct - we use lvmconfig
now even for generating the lvm.conf itself).

9 years agoreport: add vg_missing_pv_count field
Peter Rajnoha [Fri, 9 Oct 2015 14:20:29 +0000 (16:20 +0200)]
report: add vg_missing_pv_count field

We already have pv_count to report number of PVs that a VG has based
on metadata.

This patch exposes the information about how many of these PVs are
missing which is also useful information for a VG. Wwe could count
the sum of pv_missing reporting fields for each PV in the VG before,
but the new field is practical when reporting VG as a whole and there's
no need to process each PV from VG alone.

9 years agoman lvmsystemid: fix typos
David Teigland [Thu, 8 Oct 2015 18:21:42 +0000 (13:21 -0500)]
man lvmsystemid: fix typos

9 years agoman lvmsystemd: fix typo
David Teigland [Thu, 8 Oct 2015 18:14:28 +0000 (13:14 -0500)]
man lvmsystemd: fix typo

9 years agovgcreate: improve error message for multiple lock managers
David Teigland [Thu, 8 Oct 2015 15:38:35 +0000 (10:38 -0500)]
vgcreate: improve error message for multiple lock managers

If 'vgcreate --shared' finds both sanlock and dlm are running,
print a more accurate error message:
"Found multiple lock managers, select one with --lock-type."

When neither is running, we still print:
"Failed to detect a running lock manager to select lock type."

9 years agovgcreate: allow both --shared and --lock-type options
David Teigland [Thu, 8 Oct 2015 15:14:33 +0000 (10:14 -0500)]
vgcreate: allow both --shared and --lock-type options

Using --lock-type sanlock|dlm implies --shared.

Using --shared selects lock type sanlock|dlm
(by choosing the one that's running.)

Using both --shared and --lock-type sanlock|dlm should
also be allowed (--shared is just redundant information.)

9 years agometadata: format_text: provide more detailed error message when metadata too large...
Peter Rajnoha [Thu, 8 Oct 2015 14:25:10 +0000 (16:25 +0200)]
metadata: format_text: provide more detailed error message when metadata too large for PV mda

Also, leave out the note about "circular buffer" which is
an internal imeplementation detail anyway and not quite
informational for users:

Before this patch:
$ vgcreate vg1 /dev/sda
  VG vg1 metadata too large for circular buffer
  Failed to write VG vg1.

With this patch applied:
$ vgcreate vg1 /dev/sda
  VG vg1 metadata too large: size of metadata to write is 691 bytes while PV metadata area size on /dev/sda is 512 bytes.
  Failed to write VG vg1.

9 years agoreport: identify LV hodling sanlock locks as 'private,lockd,sanlock' within lv_role...
Peter Rajnoha [Thu, 8 Oct 2015 11:44:21 +0000 (13:44 +0200)]
report: identify LV hodling sanlock locks as 'private,lockd,sanlock' within lv_role report field

Before this patch:
$ lvs -a -o name,layout,role test/lvmlock
  LV        Layout     Role
  [lvmlock] linear     public

With this patch applied:
$ lvs -a -o name,layout,role test/lvmlock
  LV        Layout     Role
  [lvmlock] linear     private,lockd,sanlock

9 years agotests: check devices with prefix aren't in use
Zdenek Kabelac [Tue, 6 Oct 2015 12:55:24 +0000 (14:55 +0200)]
tests: check devices with prefix aren't in use

Avoid running tests, when prefix already exist in the system.
As prefix just uses  PID number, we may hit a case for long
running tests, where devices from some previous runs were not
properly cleared away - detect this and fail early.
(Such machine should be inspected and fixed).

9 years agoman: lvcreate continue
Zdenek Kabelac [Tue, 6 Oct 2015 12:55:09 +0000 (14:55 +0200)]
man: lvcreate continue

Finish remaing bits of updating pages for better rendering
with -Thtml, -Tps.

9 years agoman: fsadm
Zdenek Kabelac [Mon, 5 Oct 2015 10:28:00 +0000 (12:28 +0200)]
man: fsadm

9 years agocleanup: fix compiler warning
Zdenek Kabelac [Sat, 3 Oct 2015 20:10:31 +0000 (22:10 +0200)]
cleanup: fix compiler warning

This page took 0.070586 seconds and 5 git commands to generate.