]> sourceware.org Git - lvm2.git/log
lvm2.git
8 years agotests: stacked resize of thin on raid
Zdenek Kabelac [Tue, 15 Mar 2016 22:16:47 +0000 (23:16 +0100)]
tests: stacked resize of thin on raid

8 years agolvresize: fix stacked resize
Zdenek Kabelac [Tue, 15 Mar 2016 22:13:28 +0000 (23:13 +0100)]
lvresize: fix stacked resize

Commit b64703401da1f4bef60579a0b3766c087fcfe96a cause regression
when handling stacked resize of pool metadata volume that would
be a raid LV.

Fix it by properly setting up size also for layer extension.

8 years agotests: update lvconvert test
Zdenek Kabelac [Mon, 14 Mar 2016 22:22:19 +0000 (23:22 +0100)]
tests: update lvconvert test

8 years agotests: use own PID path for lvmetad checking
Zdenek Kabelac [Mon, 14 Mar 2016 22:16:45 +0000 (23:16 +0100)]
tests: use own PID path for lvmetad checking

Do not try to check PID of running lvmetad and use own path.

8 years agolvconvert: fix error path test
Zdenek Kabelac [Mon, 14 Mar 2016 22:19:22 +0000 (23:19 +0100)]
lvconvert: fix error path test

lvremove_single toollib function returns
ECMD_FAILED or ECMD_PROCESSED.

8 years agoreport: Use default vg_name field width too.
Alasdair G Kergon [Mon, 14 Mar 2016 09:30:51 +0000 (09:30 +0000)]
report: Use default  vg_name field width too.

8 years agopost-release
Alasdair G Kergon [Fri, 11 Mar 2016 00:21:53 +0000 (00:21 +0000)]
post-release

8 years agopre-release v2_02_146
Alasdair G Kergon [Fri, 11 Mar 2016 00:19:16 +0000 (00:19 +0000)]
pre-release

8 years agoman: vgcreate shared
David Teigland [Thu, 10 Mar 2016 21:40:37 +0000 (15:40 -0600)]
man: vgcreate shared

8 years agopvchange, pvresize: move exported VG check
David Teigland [Thu, 10 Mar 2016 19:28:47 +0000 (13:28 -0600)]
pvchange, pvresize: move exported VG check

Allow pvchange and pvresize to process exported VGs,
and have them check for the exported state in their
single function.

Previously, the exported VG state would trigger a
failure in vg_read()/ignore_vg() because the VGs are
being read with READ_FOR_UPDATE.  Because these commands
read all VGs to search for the intended PVs, any
exported VG would trigger a failure, even if it was
not related to the intended PV.

8 years agolvconvert: update --help
Zdenek Kabelac [Sat, 5 Mar 2016 20:02:30 +0000 (21:02 +0100)]
lvconvert: update --help

Use  <>  around user entered option parameters to make it visually
different (just like we use Italic style in man page).

TODO:

In the future we should consistently provide such notation and
possibly generate it automagically from some internal data structures.

Preferably for man pages as well so we report actual set of supported
options.

8 years agotests: uncache with missing PV
Zdenek Kabelac [Tue, 8 Mar 2016 09:56:36 +0000 (10:56 +0100)]
tests: uncache with missing PV

For now repair of cache with missing PVs via usage of --uncache.
More will follow later.

8 years agocleanup: display_lvname
Zdenek Kabelac [Mon, 7 Mar 2016 09:45:50 +0000 (10:45 +0100)]
cleanup: display_lvname

8 years agocleanup: reoder lines
Zdenek Kabelac [Mon, 7 Mar 2016 09:30:21 +0000 (10:30 +0100)]
cleanup: reoder lines

8 years agocleanup: add backtrace
Zdenek Kabelac [Mon, 7 Mar 2016 09:20:35 +0000 (10:20 +0100)]
cleanup: add backtrace

8 years agogcc: cast time_t to 64bit
Zdenek Kabelac [Mon, 7 Mar 2016 17:12:26 +0000 (18:12 +0100)]
gcc: cast time_t to 64bit

Value is printed as uint64, so make sure right type is passed on all
platforms. Fixes gcc warning on some 32bit platforms.

8 years agotopology: handle reported sizes smaller then sector
Zdenek Kabelac [Thu, 3 Mar 2016 19:53:08 +0000 (20:53 +0100)]
topology: handle reported sizes smaller then sector

Recent kernel (4.4) start to report values smaller then sector size
(but in reporting size for SSD which support data zeroing on discard).

For now log warning and assume it really means 1 sector.

Addressing RHBZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1313377

8 years agoman: drop extra braces
Zdenek Kabelac [Fri, 4 Mar 2016 20:59:04 +0000 (21:59 +0100)]
man: drop extra braces

doclifter tool noticed wrong brackets.

8 years agoman: updates
Zdenek Kabelac [Thu, 3 Mar 2016 19:27:09 +0000 (20:27 +0100)]
man: updates

Continuing with lvconvert style updates.

Minimize usage of '\:' as zero-width break space, since html renderers
do not handle this groff sign well (some of them seems to even render
':' there).
But since we do not want see badly rendered man pages itself, prefer
the 'man visual' appearence over html page generation (man2html should
be actually fixed).

Start to use 'user input option' with Capitals more consistently.

8 years agomakefiles: avoid using vpath for rules files
Zdenek Kabelac [Wed, 9 Mar 2016 16:52:29 +0000 (17:52 +0100)]
makefiles: avoid using vpath for rules files

Fixing vpath usage as it has been checking for existance of
generated file also in the $(scrdir) e.g.:

No need to remake target '10-dm.rules.in'; using VPATH name '...'

If the $(srcdir) had been also $(builddir) and contained already
generated rules file, it's been used instead generating new
one.

(See: http://make.mad-scientist.net/papers/how-not-to-use-vpath/)

8 years agolvconvert: improve vg parameter parsing
Zdenek Kabelac [Tue, 8 Mar 2016 09:13:38 +0000 (10:13 +0100)]
lvconvert: improve vg parameter parsing

Commit abd9618dd8b77ca1974074ae76fa6a08f1a687d9 tried to improve
parsing of vg name from logical path - but still missed couple
corner cases.

This patch further improves the logic and reuses
validate_lvname_param() for parsing of lv_name.

Also explicitly checks for LVM_VG_NAME in the right case.

So now also properly parses cases like:
  'lvconvert --repairt vg/'
and will provide correct error message.

8 years agocache: check for cache fail during flush
Zdenek Kabelac [Thu, 10 Mar 2016 16:56:43 +0000 (17:56 +0100)]
cache: check for cache fail during flush

Just WARN if the cache can't be flushed because it's failed.

8 years agolvconvert: uncache handles missing PV
Zdenek Kabelac [Tue, 8 Mar 2016 09:47:27 +0000 (10:47 +0100)]
lvconvert: uncache handles missing PV

Allow to process with --uncache when some PVs are missing in VG.

So it's now possible to --uncache cached LV if the cache-pool
has missing PV.

8 years agolibdm: parse more info from cache status
Zdenek Kabelac [Wed, 9 Mar 2016 17:00:57 +0000 (18:00 +0100)]
libdm: parse more info from cache status

Parse Fail/Error/need_check/ro status info from cache.

8 years agometadata: do not issue warning message about PV dev size being 0 when the device...
Peter Rajnoha [Thu, 10 Mar 2016 12:02:38 +0000 (13:02 +0100)]
metadata: do not issue warning message about PV dev size being 0 when the device has gone just after VG read

There's a window between doing VG read and checking PV device size
against real device size. If the device is removed in this window,
the dev cache still holds struct device and pv->dev still references
that and that PV is not marked as missing. However, if we're trying
to get size for such device, the open fails because that device
doesn't exists anymore.

We called existing pv_dev_size in _check_pv_dev_sizes fn. But
pv_dev_size assigned a size of 0 if the dev_get_size it called failed
(because the device is gone).

So call the dev_get_size directly and check for the return code
in _check_pv_dev_sizes and go further only if we really know the
device size. This is to avoid confusing warning messages like:

  Device /dev/sdd1 has size of 0 sectors which is smaller than corresponding PV size of 31455207 sectors. Was device resized?
  One or more devices used as PVs in VG helter_skelter have changed sizes.

8 years agoremove unused define
David Teigland [Wed, 9 Mar 2016 19:38:04 +0000 (13:38 -0600)]
remove unused define

8 years agotest: Remove work-in-progress code from dbustest
Marian Csontos [Wed, 9 Mar 2016 13:03:17 +0000 (14:03 +0100)]
test: Remove work-in-progress code from dbustest

(cherry picked from commit 3189d4d50492f5b78cf3920a7f499fd1020983c6)

8 years agospec: Fix gobject dependency
Marian Csontos [Wed, 9 Mar 2016 10:42:55 +0000 (11:42 +0100)]
spec: Fix gobject dependency

Use python3-gobject-base instead of python3-gobject requiring xorg

(cherry picked from commit d929d82116759f53484e662b967165ef4fe4257c)

8 years agotest: skip unrelated tests while testing lvmpolld
Ondrej Kozina [Wed, 9 Mar 2016 11:32:10 +0000 (12:32 +0100)]
test: skip unrelated tests while testing lvmpolld

8 years agotest: fix inverted condition
Ondrej Kozina [Wed, 9 Mar 2016 10:31:01 +0000 (11:31 +0100)]
test: fix inverted condition

8 years agotest: Add prepare_lvmdbusd
Marian Csontos [Tue, 1 Mar 2016 10:49:05 +0000 (11:49 +0100)]
test: Add prepare_lvmdbusd

- Check for running lvmdbusd at start
- Add teardown for lvmdbusd

8 years agospec: Add missing dependency for dbusd
Marian Csontos [Tue, 23 Feb 2016 09:30:39 +0000 (10:30 +0100)]
spec: Add missing dependency for dbusd

(cherry picked from commit 7435de21492f6b37ac7664d1f27b4a8dcc4d0dd4)

8 years agotest: Comment out incorrect lockd setup
Marian Csontos [Wed, 9 Mar 2016 09:56:39 +0000 (10:56 +0100)]
test: Comment out incorrect lockd setup

8 years agotest: Move udev-lvmlockd-test to check_system
Marian Csontos [Wed, 9 Mar 2016 09:50:32 +0000 (10:50 +0100)]
test: Move udev-lvmlockd-test to check_system

8 years agotest: Update kernels to skip thin-flags with
Marian Csontos [Tue, 8 Mar 2016 08:46:34 +0000 (09:46 +0100)]
test: Update kernels to skip thin-flags with

See ed5e5c38b5ac4b7c8cb7e809d9d35c72f087e29e

8 years agolvmdbus: Fix deprecated warnings for GObject use
Tony Asleson [Tue, 8 Mar 2016 22:04:44 +0000 (16:04 -0600)]
lvmdbus:  Fix deprecated warnings for GObject use

While running on F24 a number of warnings were being emitted from using the
deprecated GObject instead of GLib.  Tested on python 3.4 and 3.5.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agolvmdbus: Fix exception during exception handling
Tony Asleson [Tue, 8 Mar 2016 21:57:15 +0000 (15:57 -0600)]
lvmdbus: Fix exception during exception handling

Python 3.5 in F24 was throwing the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/lvmdbusd/main.py", line 73, in process_request
    req.run_cmd()
  File "/usr/lib/python3.5/site-packages/lvmdbusd/request.py", line 73, in run_cmd
    self.register_error(-1, st)
  File "/usr/lib/python3.5/site-packages/lvmdbusd/request.py", line 123, in register_error
    self._reg_ending(None, error_rc, error)
  File "/usr/lib/python3.5/site-packages/lvmdbusd/request.py", line 115, in _reg_ending
    self.cb_error(self._rc_error)
  File "/usr/lib64/python3.5/site-packages/dbus/service.py", line 669, in <lambda>
    keywords[error_callback] = lambda exception: _method_reply_error(connection, message, exception)
  File "/usr/lib64/python3.5/site-packages/dbus/service.py", line 293, in _method_reply_error
    exception))
  File "/usr/lib64/python3.5/traceback.py", line 136, in format_exception_only
    return list(TracebackException(etype, value, None).format_exception_only())
  File "/usr/lib64/python3.5/traceback.py", line 442, in __init__
    if (exc_value and exc_value.__cause__ is not None
AttributeError: 'str' object has no attribute '__cause__'

This was caused because we were calling the dbus error callback with a
string instead of an actual exception.  On python 3.4 this was apparently
OK, but not with 3.5.  Corrected to pass the exception to error callback.
Change tested on both python 3.4 and 3.5.

Reported-by: Vratislav Podzimek <vpodzime@redhat.com>
Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agoreport: Tidy some field names, widths and headings.
Alasdair G Kergon [Tue, 8 Mar 2016 19:50:22 +0000 (19:50 +0000)]
report: Tidy some field names, widths and headings.

Specifying an output width of 0 now leads to a default minimum width
taken from the width of the column heading.  (Most fields should use
this.)

Components of field names are generally separated by underscores (which
are optional at run-time).  (Dropped 3 duplicate fields now covered by
this rule.)

Each field heading must be unique and generally doesn't have spaces
between words (which get capitalised) unless they are already short and
the fields are normally longer or clarity demands it.

8 years agotoollib: always process in use pvs
David Teigland [Mon, 7 Mar 2016 20:15:33 +0000 (14:15 -0600)]
toollib: always process in use pvs

With the recent conversion of pvcreate/pvremove to the
common toollib processing function, skipping in-use PVs
in _process_pvs_in_vg prevented them from being protected
as intended by the in-use flag.

The processing code for pvcreate/pvremove checks for the
in-use state itself and prevents using an in-use PV.
If a PV is skipped, it looks like an unused device and
is not protected from being used in pvcreate/pvremove.

8 years agovgscan: add --notifydbus to send a notification
David Teigland [Mon, 7 Mar 2016 16:50:45 +0000 (10:50 -0600)]
vgscan: add --notifydbus to send a notification

This command option can be used to trigger a D-Bus
notification independent of the usual notifications
that are sent from other commands as an effect of
changes to PV/VG/LV state.  If lvm is not built with
dbus notification support or if notify_dbus is disabled
in the config, this command will exit with an error.

8 years agodbus: add notification from commands
David Teigland [Mon, 22 Feb 2016 15:42:03 +0000 (09:42 -0600)]
dbus: add notification from commands

When a command modifies a PV or VG, or changes the
activation state of an LV, it will send a dbus
notification when the command is finished.  This
can be enabled/disabled with a config setting.

8 years agoraid_manip: allow for raid leg to be replaced when not both data and metadata image...
Heinz Mauelshagen [Mon, 7 Mar 2016 14:25:30 +0000 (15:25 +0100)]
raid_manip: allow for raid leg to be replaced when not both data and metadata image are on pvs

resolves rhbz#1130329

8 years agocoverity: fix possible resource leak in _print_historical_lv function
Peter Rajnoha [Mon, 7 Mar 2016 09:32:41 +0000 (10:32 +0100)]
coverity: fix possible resource leak in _print_historical_lv function

The code in _print_historical_lv function works with temporary
"descendants_buffer" that is allocated and freed within this
function.

When printing text out, we used "outf" macro which called
"out_text" fn and it checked return value and if failed,
the macro called "return_0" automatically. But since we
use the temporary buffer, if any of the out_text calls
fails, we need to deallocate this buffer properly - that's
the "goto_out", otherwise we'll be leaking memory.

So add new "outfgo" helper macro which does the same as "outf",
but it calls "goto_out" instead of "return_0" so we can jump
to a cleanup hook at the end.

8 years agopost-release
Alasdair G Kergon [Fri, 4 Mar 2016 18:06:24 +0000 (18:06 +0000)]
post-release

8 years agopre-release v2_02_145
Alasdair G Kergon [Fri, 4 Mar 2016 17:59:21 +0000 (17:59 +0000)]
pre-release

8 years agolvmdbusd: Set locale
Tony Asleson [Fri, 4 Mar 2016 16:13:04 +0000 (10:13 -0600)]
lvmdbusd: Set locale

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agodbustest.sh: Get dbus test to work on buildbot
Marian Csontos [Tue, 23 Feb 2016 08:13:01 +0000 (09:13 +0100)]
dbustest.sh: Get dbus test to work on buildbot

- stdout/stderr for test output
- debug.log* for daemon output
- use install instead of cp for DBus config
- use system bus
- DBus reloads on new file. Better having it created with correct
  permissions.

Notes:
- Squashed commits from mcsontos development branch
- Still disabled at this time

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agolibdm: config: fix dm_config_write_node and variants to properly return error on...
Peter Rajnoha [Fri, 4 Mar 2016 14:49:00 +0000 (15:49 +0100)]
libdm: config: fix dm_config_write_node and variants to properly return error on failures

The error was not propagated if _write_config (that is part of
dm_config_write_node and all its variants) was called recursively
for subsections.

8 years agocleanup: previous patch with libdm config node buffer size
Peter Rajnoha [Fri, 4 Mar 2016 14:19:09 +0000 (15:19 +0100)]
cleanup: previous patch with libdm config node buffer size

8 years agolibdm: config: remove 4096 char limit due to buffer size if writing dm_config_node
Peter Rajnoha [Fri, 4 Mar 2016 13:59:22 +0000 (14:59 +0100)]
libdm: config: remove 4096 char limit due to buffer size if writing dm_config_node

8 years agoWHATS_NEW: historical LVs
Peter Rajnoha [Fri, 4 Mar 2016 11:08:02 +0000 (12:08 +0100)]
WHATS_NEW: historical LVs

8 years agoman: lvrename: also mention possibility to rename historical logical volumes
Peter Rajnoha [Fri, 4 Mar 2016 10:51:57 +0000 (11:51 +0100)]
man: lvrename: also mention possibility to rename historical logical volumes

8 years agocleanup: comment in the code for renaming historical LVs
Peter Rajnoha [Fri, 4 Mar 2016 10:46:29 +0000 (11:46 +0100)]
cleanup: comment in the code for renaming historical LVs

8 years agolvrename: support renaming historical logical volumes
Peter Rajnoha [Fri, 4 Mar 2016 10:36:24 +0000 (11:36 +0100)]
lvrename: support renaming historical logical volumes

8 years agocommands: lvdisplay: recognize -H|--history switch
Peter Rajnoha [Fri, 4 Mar 2016 09:27:45 +0000 (10:27 +0100)]
commands: lvdisplay: recognize -H|--history switch

8 years agotests: direct control of lvm1 usage in tests
David Teigland [Wed, 2 Mar 2016 22:49:32 +0000 (16:49 -0600)]
tests: direct control of lvm1 usage in tests

Using lvm1 metadata with lvmetad is not generally allowed,
but nothing has prevented creating new lvm1 metadata with
lvmetad (missing error checking in pvcreate/vgcreate.)
Various tests are using lvm1 with lvmetad and happen to
work because of the missing error checks.

This commit fixes the tests so they won't fail when the
lvm1/lvmetad error checking is fixed.  A new variable
LVM_TEST_LVM1 is defined and is used in the scripts to
decide if lvm1 metadata should be tested.  LVM_TEST_LVM1
is not defined when lvmetad is being tested, and the
combination of LVM_TEST_LVM1 and LVM_TEST_LVMETAD can
be used to verify the desired lvmetad+lvm1 behavior.

8 years agoman: Add some information about historical LVs.
Alasdair G Kergon [Thu, 3 Mar 2016 17:09:25 +0000 (17:09 +0000)]
man: Add some information about historical LVs.

8 years agotests: add lv-ancestry.sh test
Peter Rajnoha [Tue, 1 Mar 2016 14:32:32 +0000 (15:32 +0100)]
tests: add lv-ancestry.sh test

8 years agotests: add "get lvh_field" for "lvs -H"
Peter Rajnoha [Tue, 1 Mar 2016 14:32:20 +0000 (15:32 +0100)]
tests: add "get lvh_field" for "lvs -H"

8 years agolvmdump: also list historical LVs in lvmdump
Peter Rajnoha [Thu, 3 Mar 2016 09:36:58 +0000 (10:36 +0100)]
lvmdump: also list historical LVs in lvmdump

8 years agometadata: automatically remove invalid (dangling) historical LVs
Peter Rajnoha [Wed, 2 Mar 2016 11:19:07 +0000 (12:19 +0100)]
metadata: automatically remove invalid (dangling) historical LVs

Historical LV is valid as long as there is at least one live LV among
its ancestors. If we find any invalid (dangling) historical LVs, remove
them automatically.

8 years agometadata: also validate historical LVs in VG in vg_validate and check_lv_segments
Peter Rajnoha [Tue, 1 Mar 2016 14:32:01 +0000 (15:32 +0100)]
metadata: also validate historical LVs in VG in vg_validate and check_lv_segments

8 years agometadata: also look at historical LVs when checking LV name availability
Peter Rajnoha [Tue, 1 Mar 2016 14:31:48 +0000 (15:31 +0100)]
metadata: also look at historical LVs when checking LV name availability

Live LVs and historical LVs are in one namespace and the name needs to
be unique in whole VG.

8 years agoconf: regenerate example.conf.in
Peter Rajnoha [Tue, 1 Mar 2016 14:31:29 +0000 (15:31 +0100)]
conf: regenerate example.conf.in

8 years agoconf: add metadata/lvs_history_timeout configuration setting
Peter Rajnoha [Tue, 1 Mar 2016 14:29:27 +0000 (15:29 +0100)]
conf: add metadata/lvs_history_timeout configuration setting

8 years agometadata: add vg_strip_outdated_historical_lvs fn and call it during VG read
Peter Rajnoha [Tue, 1 Mar 2016 14:27:21 +0000 (15:27 +0100)]
metadata: add vg_strip_outdated_historical_lvs fn and call it during VG read

The vg_strip_outdated_historical_lvs iterates over the list of historical LVs
we have and it shoots down the ones which are outdated.

Configuration hook to set the timeout will be in subsequent patch.

8 years agocommands: lvremove: also process historical LVs
Peter Rajnoha [Tue, 1 Mar 2016 14:27:08 +0000 (15:27 +0100)]
commands: lvremove: also process historical LVs

8 years agometadata: add historical_glv_remove
Peter Rajnoha [Tue, 1 Mar 2016 14:26:57 +0000 (15:26 +0100)]
metadata: add historical_glv_remove

8 years agoconf: add metadata/record_lvs_history configuration setting
Peter Rajnoha [Tue, 1 Mar 2016 14:25:49 +0000 (15:25 +0100)]
conf: add metadata/record_lvs_history configuration setting

The metadata/record_lvs_history is global switch which enables or
disables recording historical LVs in metadata.

If both metadata/record_lvs_history=1 lvm.conf option and
--nohistory command switch is used at the same time, the
--nohistory prevails.

8 years agocommands: lvremove: recognize --nohistory option
Peter Rajnoha [Tue, 1 Mar 2016 14:25:37 +0000 (15:25 +0100)]
commands: lvremove: recognize --nohistory option

8 years agometadata: honour 'nohistory' switch when removing thin LVs
Peter Rajnoha [Tue, 1 Mar 2016 14:25:28 +0000 (15:25 +0100)]
metadata: honour 'nohistory' switch when removing thin LVs

When --nohistory switch is used with lvremove, the LV that is removed is
not recorded in metadata as 'historical LV'.

8 years agocmd: add 'nohistory' option and wire it up in cmd_context
Peter Rajnoha [Tue, 1 Mar 2016 14:25:14 +0000 (15:25 +0100)]
cmd: add 'nohistory' option and wire it up in cmd_context

The --nohistory switch will cause historical LVs to not be recorded
in metadata on demand.

8 years agoreport: add new 'none' lv_layout and 'history' lv_role and mark historical LVs that way
Peter Rajnoha [Tue, 1 Mar 2016 14:25:04 +0000 (15:25 +0100)]
report: add new 'none' lv_layout and 'history' lv_role and mark historical LVs that way

Report proper values for historical LVs in lv_layout and lv_role fields.
Any historical LV doesn't have any layout anymore and the role is "history".

For example:

$ lvs -H -o name,lv_attr,lv_layout,lv_role vg/-lvol1
  LV     Attr       Layout     Role
  -lvol1 ----h----- none       public,history

8 years agoreport: add full_descendants field to display descendants with history
Peter Rajnoha [Tue, 1 Mar 2016 14:24:48 +0000 (15:24 +0100)]
report: add full_descendants field to display descendants with history

Same as lv_full_ancestors, but the other way round in the ancestry chain.

8 years agoreport: add full_ancestors field to display ancestors with history
Peter Rajnoha [Tue, 1 Mar 2016 14:24:40 +0000 (15:24 +0100)]
report: add full_ancestors field to display ancestors with history

The lv_full_ancestors reporting field is just like the existing
lv_ancestors field but it also takes into account any history and
indirect relations recorded.

8 years agoreport: report historical LV names with '-' prefix
Peter Rajnoha [Tue, 1 Mar 2016 14:24:07 +0000 (15:24 +0100)]
report: report historical LV names with '-' prefix

All names for historical LVs are prefixed with '-' character to make clear
difference between live and historical LVs. The '-' can't be set by users
for live LV names during lvcreate hence we never get into a conflict with
the names that user defines for live LVs.

8 years agoreport: display (h)istorical state in lv_attr field
Peter Rajnoha [Tue, 1 Mar 2016 14:23:58 +0000 (15:23 +0100)]
report: display (h)istorical state in lv_attr field

The 'historical' state is displayed as 5th bit ("state") in the lv_attr
field and denoted by new 'h' character.

8 years agoreport: add lv_historical field to identify historical LVs
Peter Rajnoha [Tue, 1 Mar 2016 14:23:43 +0000 (15:23 +0100)]
report: add lv_historical field to identify historical LVs

The lv_historical reporting field is a simple binary field that reports
whether an LV is historical one ("historical" value or value of "1" displayed)
or not (blank string "" or value of "0" displayed).

8 years agocommands: lvs: recognize -H|--history switch
Peter Rajnoha [Tue, 1 Mar 2016 14:23:34 +0000 (15:23 +0100)]
commands: lvs: recognize -H|--history switch

When lvs command is used together with the -H|--history switch,
all historical LVs are reported as well.

8 years agoreport: display lv_name,lv_uuid,vg_name,lv_time and new lv_time_removed for historica...
Peter Rajnoha [Tue, 1 Mar 2016 14:23:23 +0000 (15:23 +0100)]
report: display lv_name,lv_uuid,vg_name,lv_time and new lv_time_removed for historical LVs

8 years agotoollib: honour '-H|--history' switch while executing process_each_lv_in_vg
Peter Rajnoha [Tue, 1 Mar 2016 14:23:05 +0000 (15:23 +0100)]
toollib: honour '-H|--history' switch while executing process_each_lv_in_vg

When processing LVs in a VG and when the -H|--history switch is used,
make process_each_lv_in_vg to iterate over historical volumes too.

For each historical LV, we use dummy struct logical_volume instance with
the "this_glv" reference set to a wrapper over proper struct
historical_logical_volume representation. This makes it possible to process
historical LVs just like normal live LVs (though a dummy one without any
segments and all the other fields zeroed and blank) and it also allows
for using all historical LV related information via lv->this_glv->historical
reference.

One can use a simple call to lv_is_historical to make a difference between
live and historical LV in all the code that is called by process_each_* fns.

8 years agocmd: add '-H|--history' switch and wire it up in cmd_context and processing_handle
Peter Rajnoha [Tue, 1 Mar 2016 14:22:48 +0000 (15:22 +0100)]
cmd: add '-H|--history' switch and wire it up in cmd_context and processing_handle

This patch adds "include_historical_lvs" field to struct cmd_context to
make it possible for the command to switch between original funcionality
where no historical LVs are processed and functionality where historical
LVs are taken into account (and reported or processed further). The switch
between these modes is done using the '-H|--history' switch on command
line.

The include_historical_lvs state is then passed to process_each_* fns
using the "include_historical_lvs" field within struct processing_handle.

8 years agometadata: add lv_is_historical fn to test if the LV is historical one
Peter Rajnoha [Tue, 1 Mar 2016 14:22:36 +0000 (15:22 +0100)]
metadata: add lv_is_historical fn to test if the LV is historical one

8 years agometadata: format_text: interconnect historical LVs among each other and also with...
Peter Rajnoha [Tue, 1 Mar 2016 14:22:28 +0000 (15:22 +0100)]
metadata: format_text: interconnect historical LVs among each other and also with live LVs

Interconnect historical LVs in an ancestry chain and also connect the first/last
one with its live ancestor/descendant if it exists.

8 years agometadata: add support for interconnection of thin pool LV segment with indirect origin
Peter Rajnoha [Tue, 1 Mar 2016 14:21:36 +0000 (15:21 +0100)]
metadata: add support for interconnection of thin pool LV segment with indirect origin

Add support for making an interconnection between thin LV segment and
its indirect origin (which may be historical or live LV) - add a new
"indirect_origin" argument to attach_pool_lv function.

8 years agometadata: add find_historical_glv fn
Peter Rajnoha [Tue, 1 Mar 2016 14:21:21 +0000 (15:21 +0100)]
metadata: add find_historical_glv fn

The find_historical_glv is helper function that looks up historical
LV in struct volume_group's historical_lvs list and returns it if
found.

8 years agometadata: format_text: import historical LVs
Peter Rajnoha [Tue, 1 Mar 2016 14:54:02 +0000 (15:54 +0100)]
metadata: format_text: import historical LVs

Import historical LV list from metadata and add it to struct
volume_group's historical_lvs list.

8 years agometadata: format_text: reuse _print_timestamp fn
Peter Rajnoha [Tue, 1 Mar 2016 14:21:05 +0000 (15:21 +0100)]
metadata: format_text: reuse _print_timestamp fn

8 years agometadata: format_text: also export historical LVs
Peter Rajnoha [Tue, 1 Mar 2016 14:20:49 +0000 (15:20 +0100)]
metadata: format_text: also export historical LVs

Also export historical LVs when exporting LVM2 metadata.
This is list of all historical LVs listed in
"historical_logical_volumes" metadata section with all
the properties exported for each historical LV.

For example, we have this thin snapshot sequence:

  lvol1 --> lvol2 --> lvol3
                 \
                  --> lvol4

We end up with these metadata:

logical_volume {
  ...
  (lvol1, lvol3 and lvol4 listed here as usual - no change here)
  ...
}

historical_logical_volumes {
  lvol2 {
    id = "S0Dw1U-v5sF-LwAb-W9SI-pNOF-Madd-5dxSv5"
    creation_time = 1456919613      # 2016-03-02 12:53:33 +0100
    removal_time = 1456919620       # 2016-03-02 12:53:40 +0100
    origin = "lvol1"
    descendants = ["lvol3", "lvol4"]
  }
}

By removing lvol1 further, we end up with:

historical_logical_volumes {
  lvol2 {
    id = "S0Dw1U-v5sF-LwAb-W9SI-pNOF-Madd-5dxSv5"
    creation_time = 1456919613      # 2016-03-02 12:53:33 +0100
    removal_time = 1456919620       # 2016-03-02 12:53:40 +0100
    origin = "-lvol1"
    descendants = ["lvol3", "lvol4"]
  }

  lvol1 {
    id = "me0mes-aYnK-nRfT-vNlV-UiR1-GP7r-ojbROr"
    creation_time = 1456919608      # 2016-03-02 12:53:28 +0100
    removal_time = 1456919767       # 2016-03-02 12:56:07 +0100
  }
}

8 years agometadata: create historical LVs when LVs are removed and interconnect with live LVs
Peter Rajnoha [Tue, 1 Mar 2016 14:20:09 +0000 (15:20 +0100)]
metadata: create historical LVs when LVs are removed and interconnect with live LVs

When an LV is being removed, we create an instance of
"struct historical_logical_volume" wrapped up in
"struct generic_logical_volume".

All instances of "struct historical_logical_volume" are then recorded in
"historical_lvs" list which is part of "struct volume_group".

The "historical LV" is then interconnected with "live LVs" to
connect a history chain for the live LV.

8 years agometadata: add add_glv_to_indirect_glvs and remove_glv_from_indirect_glvs
Peter Rajnoha [Tue, 1 Mar 2016 14:19:57 +0000 (15:19 +0100)]
metadata: add add_glv_to_indirect_glvs and remove_glv_from_indirect_glvs

The add_glv_to_indirect_glvs is a helper function that registers a
volume represented by struct generic_logical_volume instance ("glv")
as an indirect user of another volume ("origin_glv") and vice versa -
it also registers the other volume ("origin_glv") as indirect_origin
of user volume ("glv").

The remove_glv_from_indirect_glvs does the opposite.

8 years agometadata: add get_or_create_glv and get_or_create_glvl
Peter Rajnoha [Tue, 1 Mar 2016 14:19:23 +0000 (15:19 +0100)]
metadata: add get_or_create_glv and get_or_create_glvl

The get_or_create_glv is helper function that retrieves any existing
generic_logical_volume wrapper for the LV. If the wrapper does not exist
yet, it's created.

The get_org_create_glvl is the same as get_or_create_glv but it creates
the glv_list wrapper in addition so it can be added to a list.

8 years agometadata: add infrastructure to track LV history
Peter Rajnoha [Tue, 1 Mar 2016 14:18:42 +0000 (15:18 +0100)]
metadata: add infrastructure to track LV history

Add new structures and new fields in existing structures to support
tracking history of LVs (the LVs which don't exist - the have been
removed already):

  - new "struct historical_logical_volume"
    This structure keeps information specific to historical LVs
    (historical LV is very reduced form of struct logical_volume +
     it contains a few specific fields to track historical LV
     properties like removal time and connections among other LVs).

  - new "struct generic_logical_volume"
    Wrapper for "struct historical_logical_volume" and
    "struct logical_volume" to make it possible to handle volumes
    in uniform way, no matter if it's live or historical one.

  - new "struct glv_list"
    Wrapper for "struct generic_logical_volume" so it can be
    added to a list.

  - new "indirect_glvs" field in "struct logical_volume"
    List that stores references to all indirect users of this LV - this
    interconnects live LV with historical descendant LVs or even live
    descendant LVs.

  - new "indirect_origin" field in "struct lv_segment"
    Reference to indirect origin of this segment - this interconnects
    live LV (segment) with historical ancestor.

  - new "this_glv" field in "struct logical_volume"
    This references an existing generic_logical_volume wrapper for this
    LV, if used. It can be NULL if not needed - which means we're not
    handling historical LVs at all.

  - new "historical_lvs" field in "struct volume group
    List of all historical LVs read from VG metadata.

8 years agotests: drop check for md5sum
Zdenek Kabelac [Wed, 2 Mar 2016 10:12:00 +0000 (11:12 +0100)]
tests: drop check for md5sum

8 years agotests: check kernel_cache_ funcs
Zdenek Kabelac [Wed, 2 Mar 2016 10:12:14 +0000 (11:12 +0100)]
tests: check kernel_cache_ funcs

8 years agocleanup: use lv_is_partial
Zdenek Kabelac [Wed, 2 Mar 2016 19:59:03 +0000 (20:59 +0100)]
cleanup: use lv_is_partial

Check for PARTIAL_LV flag in standard way.

8 years agocleanup: use _field_string
Zdenek Kabelac [Wed, 2 Mar 2016 10:50:12 +0000 (11:50 +0100)]
cleanup: use _field_string

Make at least some 'advantage' in use local func and do dereference
internally from char pointer and use short list of params.

8 years agoman: minor updates
Zdenek Kabelac [Wed, 2 Mar 2016 22:51:59 +0000 (23:51 +0100)]
man: minor updates

Minor fixes in few pages.

8 years agoman: lvconvert updates
Zdenek Kabelac [Wed, 2 Mar 2016 22:51:16 +0000 (23:51 +0100)]
man: lvconvert updates

Improving style (following lvcreate way).
Sorting options alphabetically.

8 years agocache: add kernel_cache_policy option
Zdenek Kabelac [Wed, 2 Mar 2016 10:12:46 +0000 (11:12 +0100)]
cache: add kernel_cache_policy option

Pair kernel_cache_settings with kernel_cache_policy.
There is very small chance in error case that the value in table
might be differnet from the value stored in metadata
so make it 'checkable'.

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