]> sourceware.org Git - lvm2.git/log
lvm2.git
8 years agocleanup: lvchange uses display_lvname
Zdenek Kabelac [Thu, 30 Jun 2016 08:45:58 +0000 (10:45 +0200)]
cleanup: lvchange uses display_lvname

Convert messages to report vg/lv name consistently.

Also drop unneeded 'info_obtaned' variable since the
obtained info is not reused in any code path.

8 years agocleanup: drop unused assignments
Zdenek Kabelac [Thu, 30 Jun 2016 08:45:52 +0000 (10:45 +0200)]
cleanup: drop unused assignments

In all code paths we set a value for these variables, so drop
their initial unused assign.

8 years agocleanup: add extra test for argc==0
Zdenek Kabelac [Thu, 30 Jun 2016 08:27:10 +0000 (10:27 +0200)]
cleanup: add extra test for argc==0

Cleaup some compiler warning about posibility to allocate 0 size.

8 years agothin: fix link validation for unused thin-pool
Zdenek Kabelac [Thu, 30 Jun 2016 13:54:27 +0000 (15:54 +0200)]
thin: fix link validation for unused thin-pool

This patch fixes link validation for used thin-pool.
Udev rules correctly creates symlinks only for unused new thin-pool.
Such thin-pool can be used by foreing apps (like Docker) thus
has  /dev/vg/lv link.
However when thin-pool becomes used by thinLV - this link is no
longer exposed to user - but internal verfication missed this
and caused messages like this to be printed upon 'vgchange -ay':

The link /dev/vg/pool should have been created by udev but it was not
found. Falling back to direct link creation.

And same with 'vgchange -an':
The link /dev/vg/pool should have been removed by udev but it is still
present. Falling back to direct link removal.

This patch ensures only unused thin-pool has this link.

8 years agodmeventd: thin plugin umount over 95%
Zdenek Kabelac [Wed, 29 Jun 2016 13:56:29 +0000 (15:56 +0200)]
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.

8 years agolvconvert: add comments describing conversions
David Teigland [Thu, 30 Jun 2016 17:02:43 +0000 (12:02 -0500)]
lvconvert: add comments describing conversions

8 years agomacros: Use is_power_of_2.
Alasdair G Kergon [Thu, 30 Jun 2016 16:59:44 +0000 (17:59 +0100)]
macros: Use is_power_of_2.

8 years agolvconvert: add missing alias for a thin-pool conversion
David Teigland [Thu, 30 Jun 2016 15:09:54 +0000 (10:09 -0500)]
lvconvert: add missing alias for a thin-pool conversion

The case of converting a cache volume to a thin pool missed
recognizing the --thinpool alias for --type thin-pool.

8 years agolvconvert: remove unused code
David Teigland [Wed, 29 Jun 2016 21:59:32 +0000 (16:59 -0500)]
lvconvert: remove unused code

This code became unused with the previous commit 2282f5.

8 years agolvconvert: rework routing of operations
David Teigland [Tue, 28 Jun 2016 17:24:41 +0000 (12:24 -0500)]
lvconvert: rework routing of operations

Add new logic to identify each unique operation and route
it to the correct function to perform it.  The functions
that perform the conversions remain unchanged.

This new code checks every allowed combination of LV type
and requested operation, and for each valid combination
calls the function that performs that conversion.

The first stage of option validation which checks for
incompatible combinations of command line options, is done
done before process_each is called.  This is unchanged.
(This new code will allow that first stage validation to
be simplified in a future commit.)

The second stage of checking options against the specific
LV type is done by this new code.  For each valid combination
of operation + LV type, the new code calls an existing
function that implements it.

With this in place, the ad hoc checks for valid combinations
of LV types and operations can be removed from the existing
code in a future commit.

(The #if 0 is used to keep the patch clean, and the
disabled code will be removed by a following patch.)

8 years agolibdm: do not issue 'Failed to create directory' message for failure in dm_create_dir
Peter Rajnoha [Wed, 29 Jun 2016 13:58:14 +0000 (15:58 +0200)]
libdm: do not issue 'Failed to create directory' message for failure in dm_create_dir

There are detailed messages inside _create_dir_recursive that
dm_create_dir calls (except EROFS which where the message is not
generated, like anywhere else in the code).

8 years agolvconvert: Conversions between striped and raid0.
Alasdair G Kergon [Tue, 28 Jun 2016 22:44:15 +0000 (23:44 +0100)]
lvconvert: Conversions between striped and raid0.

8 years agolvmdbustest: Comment out refresh check for LV create
Tony Asleson [Tue, 28 Jun 2016 18:36:32 +0000 (13:36 -0500)]
lvmdbustest: Comment out refresh check for LV create

When we test Vg.LvCreateRaid some of the hidden LVs volume type go from
'I' to 'i' between the time it takes us to create the LV and
the time it takes to call into refresh to verify the service is up to date.
This is a fairly rare occurance.

8 years agolvmdbusd: Add --nojson command line option
Tony Asleson [Tue, 28 Jun 2016 18:32:39 +0000 (13:32 -0500)]
lvmdbusd: Add --nojson command line option

Add ability to not use the JSON output even if available.

8 years agolvmdbusd: Remove WARNING for 'lvm help'
Tony Asleson [Tue, 28 Jun 2016 17:52:31 +0000 (12:52 -0500)]
lvmdbusd: Remove WARNING for 'lvm help'

We call 'lvm help' to find out if fullreport is supported.  Lvm
dumps help to stderr.  Common code prints a warning if we exit
with 0, but have something in stderr so we are skipping the warning
message.

8 years agolvmdbusd: Remove unneeded comment
Tony Asleson [Tue, 28 Jun 2016 17:45:55 +0000 (12:45 -0500)]
lvmdbusd: Remove unneeded comment

8 years agolvmdbusd: Clean up ws
Tony Asleson [Tue, 28 Jun 2016 17:45:28 +0000 (12:45 -0500)]
lvmdbusd: Clean up ws

8 years agolvmdbusd: Remove unused imports and function parameter
Tony Asleson [Tue, 28 Jun 2016 17:44:45 +0000 (12:44 -0500)]
lvmdbusd: Remove unused imports and function parameter

8 years agolvmdbusd: Fix hang when lvm compiled with 'enable-notify-dbus'
Tony Asleson [Tue, 28 Jun 2016 17:07:21 +0000 (12:07 -0500)]
lvmdbusd: Fix hang when lvm compiled with 'enable-notify-dbus'

The following operations would hang if lvm was compiled with
'enable-notify-dbus' and the client specified -1 for the timeout:

* LV snapshot merge
* VG move
* LV move

This was caused because the implementation of these three dbus methods is
different.  Most of the dbus method calls are executed by gathering information
needed to fulfill it, placing that information on a thread safe queue and
returning.  The results later to be returned to the client with callbacks.
With this approach we can process an arbitrary number of commands without any
of them blocking other dbus commands.  However, the 3 dbus methods listed
above did not utilize this functionality because they were implemented with a
separate thread that handles the fork & exec of lvm.  This is done because these
operations can be very slow to complete.  However, because of this the lvm
command that we were waiting on is trying to call back into the dbus service to
notify it that something changed.  Because the code was blocking the process
that handles the incoming dbus activity the lvm command blocked.  We were stuck
until the client timed-out the connection, which then causes the service to
unblock and continue.  If the client did not have a timeout, we would have been
hung indefinitely.

The fix is to always utilize the worker queue on all dbus methods.  We need to
ensure that lvm is tested with 'enable-notify-dbus' enabled and disabled.

8 years agolvmdbusd: request.py, initialize _job to None
Tony Asleson [Tue, 28 Jun 2016 16:45:05 +0000 (11:45 -0500)]
lvmdbusd: request.py, initialize _job to None

_job is a job object, not a boolean so initialize it to None instead.

8 years agolvmdbusd: Correct pv_seg_start -> pvseg_start
Tony Asleson [Mon, 27 Jun 2016 22:07:20 +0000 (17:07 -0500)]
lvmdbusd: Correct pv_seg_start -> pvseg_start

Code was using the incorrect column names for pvseg_start which only
became apparent when utilizing the JSON.

8 years agolvmdbusd: Correct command line args for JSON
Tony Asleson [Mon, 27 Jun 2016 22:04:44 +0000 (17:04 -0500)]
lvmdbusd: Correct command line args for JSON

Use the updated syntax.

8 years agolvmdbusd: Remove sorting in db layer
Tony Asleson [Mon, 6 Jun 2016 20:08:20 +0000 (15:08 -0500)]
lvmdbusd: Remove sorting in db layer

When using the JSON this does not yield a totally sorted list as we don't
have a complete set of LVs, so remove this sort.

8 years agolvmdbusd: Add hidden in for json too
Tony Asleson [Fri, 3 Jun 2016 21:52:17 +0000 (16:52 -0500)]
lvmdbusd: Add hidden in for json too

8 years agolvmdbusd: Initial support for json output
Tony Asleson [Fri, 3 Jun 2016 18:18:21 +0000 (13:18 -0500)]
lvmdbusd: Initial support for json output

8 years agoraid: Infrastructure for raid takeover.
Alasdair G Kergon [Tue, 28 Jun 2016 01:42:30 +0000 (02:42 +0100)]
raid: Infrastructure for raid takeover.

8 years agolvmetad: two phase vg_remove
David Teigland [Wed, 8 Jun 2016 21:02:45 +0000 (16:02 -0500)]
lvmetad: two phase vg_remove

Apply the same idea as vg_update.
Before doing the VG remove on disk, invalidate
the VG in lvmetad.  After the VG is removed,
remove the VG in lvmetad.  If the command fails
after removing the VG on disk, but before removing
the VG metadata from lvmetad, then a subsequent
command will see the INVALID flag and not use the
stale metadata from lvmetad.

8 years agolvmetad: two phase vg_update
David Teigland [Wed, 8 Jun 2016 19:42:03 +0000 (14:42 -0500)]
lvmetad: two phase vg_update

Previously, a command sent lvmetad new VG metadata in vg_commit().
In vg_commit(), devices are suspended, so any memory allocation
done by the command while sending to lvmetad, or by lvmetad while
updating its cache could deadlock if memory reclaim was triggered.

Now lvmetad is updated in unlock_vg(), after devices are resumed.
The new method for updating VG metadata in lvmetad is in two phases:

1. In vg_write(), before devices are suspended, the command sends
   lvmetad a short message ("set_vg_info") telling it what the new
   VG seqno will be.  lvmetad sees that the seqno is newer than
   the seqno of its cached VG, so it sets the INVALID flag for the
   cached VG.  If sending the message to lvmetad fails, the command
   fails before the metadata is committed and the change is not made.
   If sending the message succeeds, vg_commit() is called.

2. In unlock_vg(), after devices are resumed, the command sends
   lvmetad the standard vg_update message with the new metadata.
   lvmetad sees that the seqno in the new metadata matches the
   seqno it saved from set_vg_info, and knows it has the latest
   copy, so it clears the INVALID flag for the cached VG.

If a command fails between 1 and 2 (after committing the VG on disk,
but before sending lvmetad the new metadata), the cached VG retains
the INVALID flag in lvmetad.  A subsequent command will read the
cached VG from lvmetad, see the INVALID flag, ignore the cached
copy, read the VG from disk instead, update the lvmetad copy
with the latest copy from disk, (this clears the INVALID flag
in lvmetad), and use the correct VG metadata for the command.

(This INVALID mechanism already existed for use by lvmlockd.)

8 years agolvmetad: remove unused code for other format types
David Teigland [Tue, 7 Jun 2016 21:09:45 +0000 (16:09 -0500)]
lvmetad: remove unused code for other format types

lvmetad is no longer used at all with the lvm1 format,
so the text format is the only one that uses lvmetad.

8 years agoWHATS_NEW: add recent changes
David Teigland [Mon, 27 Jun 2016 16:10:58 +0000 (11:10 -0500)]
WHATS_NEW: add recent changes

8 years agolvmlockd: fix coverity report
David Teigland [Mon, 27 Jun 2016 16:02:07 +0000 (11:02 -0500)]
lvmlockd: fix coverity report

8 years agolibdm: report: fix field width calculation when using dm_report_column_headings
Peter Rajnoha [Mon, 27 Jun 2016 12:27:43 +0000 (14:27 +0200)]
libdm: report: fix field width calculation when using dm_report_column_headings

This fixes commit 0ba5f4b8e977a6f2f45f95777da508b42d84c01a which moved
field recalculation (field width and sort position) from
dm_report_object to dm_report_output but it didn't handle the case when
dm_report_column_headings was used separately to report headings (before
dm_report_outpout call) and hence we ended up with intial widths for
fields in the headings.

If we're using dm_report_column_headings, we need to recalculate
fields if we haven't done so yet, the same way as we do in
dm_report_output.

8 years agoreporter: simplify --configreport handling for -S|--select and fix an issue reported...
Peter Rajnoha [Mon, 27 Jun 2016 08:14:17 +0000 (10:14 +0200)]
reporter: simplify --configreport handling for -S|--select and fix an issue reported by coverity

Simplify code around _do_get_report_selection - remove "expected_idxs[]"
argument which is superfluous and add "allow_single" switch instead to
allow for recognition of "--configreport <report_name> -S" as well as
single "-S" if needed.

Null pointer dereferences  (FORWARD_NULL) /safe/guest2/covscan/LVM2.2.02.158/tools/reporter.c: 961 in _do_report_get_selection()
Null pointer dereferences  (FORWARD_NULL) Dereferencing null pointer "single_args".

8 years agocoverity: fix issues detected in recent code
Peter Rajnoha [Mon, 27 Jun 2016 08:12:41 +0000 (10:12 +0200)]
coverity: fix issues detected in recent code

Uninitialized variables  (UNINIT) /safe/guest2/covscan/LVM2.2.02.158/tools/toollib.c: 3520 in _process_pvs_in_vgs()
Uninitialized variables  (UNINIT) Using uninitialized value "do_report_ret_code".

Null pointer dereferences  (REVERSE_INULL) /safe/guest2/covscan/LVM2.2.02.158/libdm/libdm-report.c: 4745 in dm_report_output()
Null pointer dereferences  (REVERSE_INULL) Null-checking "rh" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

Incorrect expression  (MISSING_COMMA) /safe/guest2/covscan/LVM2.2.02.158/lib/log/log.c: 280 in _get_log_level_name()
Incorrect expression  (MISSING_COMMA) In the initialization of "log_level_names", a suspicious concatenated string ""noticeinfo"" is produced.

Null pointer dereferences  (FORWARD_NULL) /safe/guest2/covscan/LVM2.2.02.158/tools/reporter.c: 816 in_get_report_options()
Null pointer dereferences  (FORWARD_NULL) Comparing "mem" to null implies that "mem" might be null.

8 years agopost-release
Alasdair G Kergon [Sat, 25 Jun 2016 19:47:49 +0000 (20:47 +0100)]
post-release

8 years agopre-release v2_02_158
Alasdair G Kergon [Sat, 25 Jun 2016 19:35:14 +0000 (20:35 +0100)]
pre-release

8 years agodoc: Resync kernel docs.
Alasdair G Kergon [Sat, 25 Jun 2016 18:59:49 +0000 (19:59 +0100)]
doc: Resync kernel docs.

8 years agoman: lvs: move doc about --all so it's ordered alphabetically in the man page
Peter Rajnoha [Fri, 24 Jun 2016 12:56:43 +0000 (14:56 +0200)]
man: lvs: move doc about --all so it's ordered alphabetically in the man page

8 years agoman: document --configreport, --logonly, --reportformat
Peter Rajnoha [Fri, 24 Jun 2016 12:51:20 +0000 (14:51 +0200)]
man: document --configreport, --logonly, --reportformat

8 years agocommands: help: add missing --reportformat references
Peter Rajnoha [Fri, 24 Jun 2016 12:49:13 +0000 (14:49 +0200)]
commands: help: add missing --reportformat references

8 years agocommands: fix typo in arg assignment
Peter Rajnoha [Fri, 24 Jun 2016 09:10:10 +0000 (11:10 +0200)]
commands: fix typo in arg assignment

8 years agocleanup: clean warns from older gcc
Zdenek Kabelac [Thu, 23 Jun 2016 23:10:04 +0000 (01:10 +0200)]
cleanup: clean warns from older gcc

Don't report uninitialized use by older gcc.

8 years agotests: update test for modified output
Zdenek Kabelac [Thu, 23 Jun 2016 20:35:51 +0000 (22:35 +0200)]
tests: update test for modified output

We now print  vg/lv  for lv resized volume

8 years agotests: smaller number of devs created to fill metadata
Zdenek Kabelac [Thu, 23 Jun 2016 22:35:42 +0000 (00:35 +0200)]
tests: smaller number of devs created to fill metadata

8 years agocleanup: type cleanup
Zdenek Kabelac [Thu, 23 Jun 2016 22:35:03 +0000 (00:35 +0200)]
cleanup: type cleanup

Fix return code 1.
Since we always check for !() - this fix has no other effect.

8 years agolvresize: let pass even protected names like _tmeta
Zdenek Kabelac [Thu, 23 Jun 2016 22:33:40 +0000 (00:33 +0200)]
lvresize: let pass even protected names like _tmeta

Only later validation can decide if the volume is actually restricted
from being resized  (unlike in lvcreate time).

8 years agolvresize: fixes for recent commit
Zdenek Kabelac [Thu, 23 Jun 2016 22:24:26 +0000 (00:24 +0200)]
lvresize: fixes for recent commit

Merging process and patch rework missed some bits - fix them.

8 years agoRevert "locking: trace errors from dir creation"
Alasdair G Kergon [Thu, 23 Jun 2016 20:31:49 +0000 (21:31 +0100)]
Revert "locking: trace errors from dir creation"

This reverts commit fa69ed0bc845df3d2c7ae68d03cdd4a3dec339d8.

This code sometimes expects to be presented with a read-only filesystem
(during some boot sequences for example) and copes appropriately with
this and it should not lead to expected error messages that might cause
unnecessary alarm.

8 years agotests: aux prepare_thin_metadata
Zdenek Kabelac [Mon, 13 Jun 2016 12:35:09 +0000 (14:35 +0200)]
tests:  aux prepare_thin_metadata

8 years agocleanup: drop setting lv_name
Zdenek Kabelac [Wed, 15 Jun 2016 12:55:37 +0000 (14:55 +0200)]
cleanup: drop setting lv_name

lv_name arg is only used without known LV for resolving '*lv'.
Once we know *lv, never use  lv_name ever again.

So setting it when passing *lv has not needed.

8 years agocleanup: remove unused code
Zdenek Kabelac [Fri, 17 Jun 2016 13:22:27 +0000 (15:22 +0200)]
cleanup: remove unused code

8 years agocleanup: remove unused sizearg variable
Zdenek Kabelac [Fri, 17 Jun 2016 11:25:56 +0000 (13:25 +0200)]
cleanup: remove unused sizearg variable

It's not used for anything now.

8 years agolvresize: return 0/1
Zdenek Kabelac [Fri, 17 Jun 2016 09:29:28 +0000 (11:29 +0200)]
lvresize: return 0/1

Returning locking LV is no longer used from here, so return 1/0.

8 years agolvresize: support more resized LVs
Zdenek Kabelac [Wed, 22 Jun 2016 21:32:35 +0000 (23:32 +0200)]
lvresize: support more resized LVs

Add code to support more LVs to be resized through a same code path
using a single lvresize_params struct.
(Now it's used for thin-pool metadata resize,
next user will be snapshot virtual resize).

Update code to adjust percent amount resize for use_policies.

Properly activate inactive thin-pool in case of any pool resize
as the command should not 'deffer' this operation to next activation.

8 years agolvresize: do not pass struct cmd
Zdenek Kabelac [Tue, 14 Jun 2016 13:32:21 +0000 (15:32 +0200)]
lvresize: do not pass struct cmd

Use common API design and pass just LV pointer to lv_manip.c functions.
Read cmd struct via    lv->vg->cmd when needed.
Also do not try to return EINVALID_CMD_LINE error when we
have already openned VG - this error code can only be returned before
locking VG.

8 years agolvresize: pass only needed params to _fsadm_cmd
Zdenek Kabelac [Wed, 15 Jun 2016 13:46:03 +0000 (15:46 +0200)]
lvresize: pass only needed params to _fsadm_cmd

Do not pass whole lvresize_params into _fsadm_cmd,
and give it only needed args.

8 years agolvresize: check pvh list is vg->pvs
Zdenek Kabelac [Thu, 16 Jun 2016 12:39:26 +0000 (14:39 +0200)]
lvresize: check pvh list is vg->pvs

Instead of checking lp->argc for arg count, compare directly whether
passed pvh is vg->pvs.

8 years agolvresize: update lvresize_params struct
Zdenek Kabelac [Fri, 17 Jun 2016 11:25:41 +0000 (13:25 +0200)]
lvresize: update lvresize_params struct

Reorganise  struct lvresize_params to better fit lvresize needs to be
able to resize more then just a single LV.

8 years agocleanup: use display_lvname
Zdenek Kabelac [Thu, 23 Jun 2016 11:04:37 +0000 (13:04 +0200)]
cleanup: use display_lvname

8 years agocleanup: add dots to some messages
Zdenek Kabelac [Tue, 14 Jun 2016 12:56:17 +0000 (14:56 +0200)]
cleanup: add dots to some messages

Add missing dots and one comment.

8 years agocleanup: code lines reodered
Zdenek Kabelac [Wed, 15 Jun 2016 09:35:16 +0000 (11:35 +0200)]
cleanup: code lines reodered

8 years agolvresize: drop extra sigint handling
Zdenek Kabelac [Wed, 8 Jun 2016 21:29:13 +0000 (23:29 +0200)]
lvresize: drop extra sigint handling

yes_no_prompt() now already handles signal checking,
so drop redundant test.

8 years agolvresize: inform about ignored args with --use-polices
Zdenek Kabelac [Tue, 14 Jun 2016 11:40:57 +0000 (13:40 +0200)]
lvresize: inform about ignored args with --use-polices

When --use-polices is specified, all size args are meaningless,
as the resize is based upon policy. So just keep user informed.

8 years agolvresize: move and extend resizefs ignoring check
Zdenek Kabelac [Wed, 20 Jan 2016 12:16:53 +0000 (13:16 +0100)]
lvresize: move and extend resizefs ignoring check

Move check for 'ignoring' --resizefs option and extend check
for some more types.

8 years agolocking: trace errors from dir creation
Zdenek Kabelac [Thu, 16 Jun 2016 09:54:24 +0000 (11:54 +0200)]
locking: trace errors from dir creation

8 years agomonitoring: preserve monitoring status during update
Zdenek Kabelac [Wed, 22 Jun 2016 21:21:27 +0000 (23:21 +0200)]
monitoring: preserve monitoring status during update

Ignore monitoring during whole update (suspend/resume) of thin-pool.

8 years agoactivation: _lv_active returns 0 on error
Zdenek Kabelac [Wed, 22 Jun 2016 21:04:53 +0000 (23:04 +0200)]
activation: _lv_active returns 0 on error

We have only 2 users of _lv_active() - one was already checking for ==1
while the other use (_lv_is_active()) could have take '-1' as a sign of having
an LV active. So return 0 and log_debug also the reason while detection
has failed (i.e. in case  --driverload n  - it's kind of expectable,
but might have confused user seeing just <backtrace>).

8 years agoactivation: switch to warning
Zdenek Kabelac [Tue, 21 Jun 2016 13:16:03 +0000 (15:16 +0200)]
activation: switch to warning

Since this function does not have a way to return error use correct
reporting level as warning.

8 years agolibdm: log: remove log_print_bypass_report calls and register new print_log_libdm...
Peter Rajnoha [Thu, 23 Jun 2016 11:55:39 +0000 (13:55 +0200)]
libdm: log: remove log_print_bypass_report calls and register new print_log_libdm for libdm during lvm initialization instead

This fixes commit f50d4011cdd3ef38c15b9dea05e73321592d93c2 which
introduced a problem when using older lvm2 code with newer libdm.
In this case, the old LVM didn't recognize new _LOG_BYPASS_REPORT flag
that libdm-report code used. This ended up with no output at all
from libdm where log_print_bypass_report was called because the
_LOG_BYPASS_REPORT was not masked properly in lvm2's print_log fn
which was called as callback function for logging.

With this patch, the lvm2 registers separate print_log_libdm logging
function for libdm instead. The print_log_libdm is exactly the same
as print_log (used throughout lvm2 code) but it checks whether we're
printing common line on output where "common" means not going to stderr,
not a warning and not an error and if we are, it adds the
_LOG_BYPASS_REPORT flag so the log_print goes directly to output, not
to any log report.

So this achieves the same goal as in f50d4011cdd3ef38c15b9dea05e73321592d93c2,
just doing it in a way that newer libdm is still compatible with older
lvm2 code (libdm-report is the only code using log_print).

Looking at the opposite mixture - older libdm with newer lvm2 code,
that won't be compilable because the new log report functionality
that is in lvm2 also requires new dm_report_group_* libdm functions
so we don't need to care here.

8 years agolog: move original print_log code to _vprint_log and make print_log a wrapper over...
Peter Rajnoha [Thu, 23 Jun 2016 11:39:38 +0000 (13:39 +0200)]
log: move original print_log code to _vprint_log and make print_log a wrapper over _vprint_log

Move code from original print_log fn to a separate _vprint_log function
that accepts va_list and make print_log a wrapper over _vprint_log.
The print_log just initializes the va_list and uses it for _vprint_log
call now. This way, we can reuse _vprint_log if needed.

8 years agofilters: add comments about internal filter position in filter chain
Peter Rajnoha [Thu, 23 Jun 2016 07:37:51 +0000 (09:37 +0200)]
filters: add comments about internal filter position in filter chain

8 years agolvconvert: Fix --stripes handling.
Alasdair G Kergon [Wed, 22 Jun 2016 21:10:42 +0000 (22:10 +0100)]
lvconvert: Fix --stripes handling.

Only treat --stripes as meaning --type striped if no other type was
first detected.  If a segtype got selected, don't override it later.

8 years agovgimportclone: add native command
David Teigland [Wed, 25 May 2016 18:57:33 +0000 (13:57 -0500)]
vgimportclone: add native command

This is cleaner and more efficient than the script.
The args and usage are unchanged.

8 years agolvconvert: Refactor argument handling code.
Alasdair G Kergon [Wed, 22 Jun 2016 17:40:22 +0000 (18:40 +0100)]
lvconvert: Refactor argument handling code.

Begin disentangling the different lvconvert modes of operation
from each other.

8 years agotools: Use arg_is_set instead of arg_count.
Alasdair G Kergon [Tue, 21 Jun 2016 21:24:52 +0000 (22:24 +0100)]
tools: Use arg_is_set instead of arg_count.

8 years agovgcfgrestore: rescan to reenable lvmetad on error path
David Teigland [Tue, 21 Jun 2016 16:40:42 +0000 (11:40 -0500)]
vgcfgrestore: rescan to reenable lvmetad on error path

In commit 6ae22125, vgcfgrestore began disabling lvmetad
while running, and rescanned to enable it again at the end,
but missed the rescanning/enabling in the error case.

8 years agovgcfgrestore: check for missing device
David Teigland [Mon, 20 Jun 2016 21:02:07 +0000 (16:02 -0500)]
vgcfgrestore: check for missing device

The missing device will generally be seen earlier
and cause the command to not reach this point, but
check anyway for completeness.

8 years agolvmlockd: always try to connect to lvmetad
David Teigland [Mon, 20 Jun 2016 18:47:26 +0000 (13:47 -0500)]
lvmlockd: always try to connect to lvmetad

Reconnect to lvmetad if either the send fails (e.g. lvmetad
was restarted since lvmlockd last connected), or if no
lvmetad connection exists (e.g. lvmetad was started after
lvmlockd so no previous connection existed.)

8 years agolvmetad: process new connections after shutdown signal
David Teigland [Mon, 20 Jun 2016 18:19:02 +0000 (13:19 -0500)]
lvmetad: process new connections after shutdown signal

Currently, a shutdown signal will cause lvmetad to quit
responding to new connections, but not actually exit until
all connections are gone.  If a program is maintaining a
long running connection (e.g. lvmlockd, or even an lvm
command) when lvmetad gets a shutdown signal, then all
further commands will hang indefinately waiting for a
response that won't be sent.

With this patch, make lvmetad continue handling new
connections even after a shutdown signal.  It will exit
once all connections are gone.

8 years agovgcfgrestore: use lvmetad disabled state
David Teigland [Fri, 17 Jun 2016 21:37:30 +0000 (16:37 -0500)]
vgcfgrestore: use lvmetad disabled state

Previously, vgcfgrestore would attempt to vg_remove the
existing VG from lvmetad and then vg_update to add the
restored VG.  But, if there was a failure in the command
or with vg_update, the lvmetad cache would be left incorrect.
Now, disable lvmetad before the restore begins, and then
rescan to populate lvmetad from disk after restore has
written the new VG to disk.

8 years agovgscan: fix process_each args
David Teigland [Mon, 20 Jun 2016 16:18:36 +0000 (11:18 -0500)]
vgscan: fix process_each args

zero/null args were mixed up.

8 years agoconf: add more comments for new settings related to output format and log report
Peter Rajnoha [Mon, 20 Jun 2016 14:21:38 +0000 (16:21 +0200)]
conf: add more comments for new settings related to output format and log report

8 years agocleanup: log: use hex numbers instead of decimal for _LOG_*
Peter Rajnoha [Mon, 20 Jun 2016 12:22:31 +0000 (14:22 +0200)]
cleanup: log: use hex numbers instead of decimal for _LOG_*

8 years agolog: add 'label' log report object type; annotate process_each_label with log_set_rep...
Peter Rajnoha [Mon, 20 Jun 2016 11:46:35 +0000 (13:46 +0200)]
log: add 'label' log report object type; annotate process_each_label with log_set_report_object_{type, id_and_name} and report_log_ret_code

8 years agoreport: compare --configreport value with basic report type
Peter Rajnoha [Mon, 20 Jun 2016 11:15:33 +0000 (13:15 +0200)]
report: compare --configreport value with basic report type

Reporting commands can be of different types (even if the command name
is the same):
  - pvs command can be either of PVS, PVSEGS or LABEL report type,
  - vgs command is of VGS report type,
  - lvs command is of LVS or SEGS report type.

Use basic report type when looking for report prefix used for
--configreport option.

This means that:
  - 'pvs --configreport pv' applies to PVS, PVSEGS or LABEL report type
  - 'vgs --configreport vg' applies to VGS report type
  - 'lvs --configreport lv' applies to LVS and SEGS report type

8 years agocommands: add --configreport arg for all relevant commands
Peter Rajnoha [Mon, 20 Jun 2016 09:57:24 +0000 (11:57 +0200)]
commands: add --configreport arg for all relevant commands

8 years agoconf: regenerate profile templates
Peter Rajnoha [Mon, 20 Jun 2016 09:25:24 +0000 (11:25 +0200)]
conf: regenerate profile templates

8 years agoreport: add --logonly arg to report only log for a command
Peter Rajnoha [Wed, 15 Jun 2016 11:35:27 +0000 (13:35 +0200)]
report: add --logonly arg to report only log for a command

8 years agoreport: use report type description for report's name if using DM_REPORT_GROUP_BASIC...
Peter Rajnoha [Tue, 14 Jun 2016 14:44:52 +0000 (16:44 +0200)]
report: use report type description for report's name if using DM_REPORT_GROUP_BASIC output format

8 years agolibdm: select: recognize special selection string 'all' as an alias for blank selecti...
Peter Rajnoha [Mon, 13 Jun 2016 13:23:44 +0000 (15:23 +0200)]
libdm: select: recognize special selection string 'all' as an alias for blank selection string

8 years agoconf: add log/command_log_selection config setting
Peter Rajnoha [Tue, 14 Jun 2016 11:25:03 +0000 (13:25 +0200)]
conf: add log/command_log_selection config setting

8 years agolog: use separate 'orphan' report object type for orphan VGs
Peter Rajnoha [Tue, 14 Jun 2016 11:21:53 +0000 (13:21 +0200)]
log: use separate 'orphan' report object type for orphan VGs

8 years agotools: add 'lvm lastlog' command for interactive query and display of last command...
Peter Rajnoha [Fri, 20 May 2016 13:30:58 +0000 (15:30 +0200)]
tools: add 'lvm lastlog' command for interactive query and display of last command's log

If we're running in lvm shell, we can keep last command's log report
for further query with possible different selection criteria for easy
log lookup.

8 years agorefactor: move 'interactive' field from struct command_line to struct cmd_context...
Peter Rajnoha [Fri, 20 May 2016 12:23:43 +0000 (14:23 +0200)]
refactor: move 'interactive' field from struct command_line to struct cmd_context as 'is_interactive' switch

8 years agolog: annotate processing code with report_current_object_cmdlog
Peter Rajnoha [Mon, 23 May 2016 13:27:09 +0000 (15:27 +0200)]
log: annotate processing code with report_current_object_cmdlog

8 years agolog: annotate processing code with log_set_report_{context,object_type,id_and_name}
Peter Rajnoha [Fri, 20 May 2016 11:26:02 +0000 (13:26 +0200)]
log: annotate processing code with log_set_report_{context,object_type,id_and_name}

8 years agoreport: add 'multiple_output' arg to report_init
Peter Rajnoha [Thu, 12 May 2016 12:37:38 +0000 (14:37 +0200)]
report: add 'multiple_output' arg to report_init

Some reports may be reported several times with possible different
selection criteria, just like command log report.

8 years agolibdm: report: add dm_report_set_selection
Peter Rajnoha [Thu, 12 May 2016 13:04:37 +0000 (15:04 +0200)]
libdm: report: add dm_report_set_selection

Since we can do repeated dm_report_output calls now, we also like
to be able to set selection for each of these outputs.

8 years agolibdm: report: add DM_REPORT_OUTPUT_MULTIPLE_TIMES report flag to keep report data...
Peter Rajnoha [Thu, 12 May 2016 12:34:04 +0000 (14:34 +0200)]
libdm: report: add DM_REPORT_OUTPUT_MULTIPLE_TIMES report flag to keep report data even after output is done

The DM_REPORT_OUTPUT_MULTIPLE_TIMES instructs reporting code to
keep rows even after dm_report_output call - the rows are not
destroyed in this case which makes it possible to call dm_report_output
multiple times.

8 years agorefactor: move field width calculation and sort preparation from _do_report_object...
Peter Rajnoha [Thu, 12 May 2016 12:07:05 +0000 (14:07 +0200)]
refactor: move field width calculation and sort preparation from _do_report_object to dm_report_output

This also prepares code for repeated dm_report_output calls.

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