]> sourceware.org Git - lvm2.git/log
lvm2.git
8 years agotests: update vg-check-devs-used.sh
Peter Rajnoha [Tue, 22 Mar 2016 10:18:16 +0000 (11:18 +0100)]
tests: update vg-check-devs-used.sh

Snapshot needs to be activated exclusively in cluster...

8 years agotests: update vg-check-devs-used.sh
Peter Rajnoha [Tue, 22 Mar 2016 10:13:28 +0000 (11:13 +0100)]
tests: update vg-check-devs-used.sh

8 years agodev: also count with suffixes in UUID for LVs when constructing VGID and LVID index
Peter Rajnoha [Tue, 22 Mar 2016 09:28:01 +0000 (10:28 +0100)]
dev: also count with suffixes in UUID for LVs when constructing VGID and LVID index

UUID for LV is either "LVM-<vg_uuid><lv_uuid>" or "LVM-<vg_uuid><lv_uuid>-<suffix>".
The code before just checked the length of the UUID based on the first
template, not the variant with suffix - so LVs with this suffix were not
processed properly.

For example a thin pool LV (as an example of an LV that contains
sub LVs where UUIDs have suffixes):

[0] fedora/~ # lsblk -s /dev/vg/lvol1
NAME              MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vg-lvol1          253:8    0    4M  0 lvm
`-vg-pool-tpool   253:6    0  116M  0 lvm
  |-vg-pool_tmeta 253:2    0    4M  0 lvm
  | `-sda           8:0    0  128M  0 disk
  `-vg-pool_tdata 253:3    0  116M  0 lvm
    `-sda           8:0    0  128M  0 disk

Before this patch (spurious warning message about device mismatch):

[0] fedora/~ # pvs
  WARNING: Device mismatch detected for vg/lvol1 which is accessing /dev/mapper/vg-pool-tpool instead of (null).
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda   vg     lvm2 a--  124.00m    0

With this patch applied (no spurious warning message about device mismatch):

[0] fedora/~ # pvs
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda   vg     lvm2 a--  124.00m    0

8 years agodev: also check for blank sysfs value containing only '\n'
Peter Rajnoha [Tue, 22 Mar 2016 08:29:24 +0000 (09:29 +0100)]
dev: also check for blank sysfs value containing only '\n'

8 years agoreport: Add pv_major, pv_minor to reports.
Alasdair G Kergon [Tue, 22 Mar 2016 00:12:08 +0000 (00:12 +0000)]
report: Add pv_major, pv_minor to reports.

8 years agolvmdbusd: Change print statements to log_error
Tony Asleson [Mon, 21 Mar 2016 22:24:04 +0000 (17:24 -0500)]
lvmdbusd: Change print statements to log_error

Should not be using print() in the service code.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agolvmdbusd: Add lvm flight recorder
Tony Asleson [Mon, 21 Mar 2016 22:22:56 +0000 (17:22 -0500)]
lvmdbusd: Add lvm flight recorder

To help out with debug, when an exception is thrown in the dbus service we
will dump all the information we have on the last 16 commands that were
executed along with the stack strace.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agolvmdbusd: Allow PV devices to be referenced by symlink(s)
Tony Asleson [Mon, 21 Mar 2016 22:19:38 +0000 (17:19 -0500)]
lvmdbusd: Allow PV devices to be referenced by symlink(s)

See: https://bugzilla.redhat.com/show_bug.cgi?id=1318754

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agolvmdbusd: Remove --udev in service file
Tony Asleson [Mon, 21 Mar 2016 15:18:18 +0000 (10:18 -0500)]
lvmdbusd: Remove --udev in service file

With commit 2d5dc6512e10924ab68e6a139081d7121bc3f7d6 the dbus server
no longer needs to utilize udev to know when to update its internal
state.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
8 years agotests: add vg-check-devs-used.sh
Peter Rajnoha [Mon, 21 Mar 2016 15:21:30 +0000 (16:21 +0100)]
tests: add vg-check-devs-used.sh

8 years agodev: be safer when reading sysfs properties
Peter Rajnoha [Mon, 21 Mar 2016 14:48:36 +0000 (15:48 +0100)]
dev: be safer when reading sysfs properties

Check if the value we read from sysfs is not blank and replace the '\n'
at the end only when needed ('\n' should usually be there for sysfs values,
but better check this).

8 years agotest: Turn on dbus test
Marian Csontos [Tue, 23 Feb 2016 08:00:35 +0000 (09:00 +0100)]
test: Turn on dbus test

(cherry picked from commit f1ea96c6c1dc6414169bda1a18cf14cd9ebb1493)

8 years agometadata: use own mem pool to report PV device mismatch in VG
Peter Rajnoha [Mon, 21 Mar 2016 13:38:49 +0000 (14:38 +0100)]
metadata: use own mem pool to report PV device mismatch in VG

8 years agodev: detect mismatch between devices used and devices assumed for an LV
Peter Rajnoha [Wed, 16 Mar 2016 13:01:26 +0000 (14:01 +0100)]
dev: detect mismatch between devices used and devices assumed for an LV

It's possible for an LVM LV to use a device during activation which
then differs from device which LVM assumes based on metadata later on.

For example, such device mismatch can occur if LVM doesn't have
complete view of devices during activation or if filters are
misbehaving or they're incorrectly set during activation.

This patch adds code that can detect this mismatch by creating
VG UUID and LV UUID index while scanning devices for device cache.

The VG UUID index maps VG UUID to a device list. Each device in the
list has a device layered above as a holder which is an LVM LV device
and for which we know the VG UUID (and similarly for LV UUID index).

We can acquire VG and LV UUID by reading /sys/block/<dm_dev_name>/dm/uuid.
So these indices represent the actual state of PV device use in
the system by LVs and then we compare that to what LVM assumes
based on metadata.

For example:

[0] fedora/~ # lsblk /dev/sdq /dev/sdr /dev/sds /dev/sdt
NAME         MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sdq           65:0    0  104M  0 disk
|-vg-lvol0   253:2    0  200M  0 lvm
`-mpath_dev1 253:3    0  104M  0 mpath
sdr           65:16   0  104M  0 disk
`-mpath_dev1 253:3    0  104M  0 mpath
sds           65:32   0  104M  0 disk
|-vg-lvol0   253:2    0  200M  0 lvm
`-mpath_dev2 253:4    0  104M  0 mpath
sdt           65:48   0  104M  0 disk
`-mpath_dev2 253:4    0  104M  0 mpath

In this case the vg-lvol0 is mapped onto sdq and sds becauset this is
what was available and seen during activation. Then later on, sdr and
sdt appeared and mpath devices were created out of sdq+sdr (mpath_dev1)
and sds+sdt (mpath_dev2). Now, LVM assumes (correctly) that mpath_dev1
and mpath_dev2 are the PVs that should be used, not the mpath
components (sdq/sdr, sds/sdt).

[0] fedora/~ # pvs
  Found duplicate PV xSUix1GJ2SK82ACFuKzFLAQi8xMfFxnO: using /dev/mapper/mpath_dev1 not /dev/sdq
  Using duplicate PV /dev/mapper/mpath_dev1 from subsystem DM, replacing /dev/sdq
  Found duplicate PV MvHyMVabtSqr33AbkUrobq1LjP8oiTRm: using /dev/mapper/mpath_dev2 not /dev/sds
  Using duplicate PV /dev/mapper/mpath_dev2 from subsystem DM, ignoring /dev/sds
  WARNING: Device mismatch detected for vg/lvol0 which is accessing /dev/sdq, /dev/sds instead of /dev/mapper/mpath_dev1, /dev/mapper/mpath_dev2.
  PV                     VG     Fmt  Attr PSize   PFree
  /dev/mapper/mpath_dev1 vg     lvm2 a--  100.00m      0
  /dev/mapper/mpath_dev2 vg     lvm2 a--  100.00m      0

8 years agodevice: add DEV_OPEN_FAILURE flag
Peter Rajnoha [Thu, 17 Mar 2016 12:45:14 +0000 (13:45 +0100)]
device: add DEV_OPEN_FAILURE flag

DEV_OPEN_FAILURE flag is set if the most recent "open" for a device
failed and it's unset if any subsequent "open" succeeds.

8 years agopost-release
Alasdair G Kergon [Sat, 19 Mar 2016 01:18:28 +0000 (01:18 +0000)]
post-release

8 years agopre-release v2_02_147
Alasdair G Kergon [Sat, 19 Mar 2016 01:14:29 +0000 (01:14 +0000)]
pre-release

8 years agofsadm: use stat to get major:minor pair for non-standard /dev layouts
Peter Rajnoha [Fri, 18 Mar 2016 14:55:36 +0000 (15:55 +0100)]
fsadm: use stat to get major:minor pair for non-standard /dev layouts

If we're using non-standard /dev layout so we can't get the dm-X name
easily, we can't also look at the /sys/blocl/dm-X/dev to get the major:minor
pair. Use "stat" in this case even though it triggers automounts
(but there's no better way for now).

8 years agofsadm: if available, use /proc/self/mountinfo to detect mounted volume
Peter Rajnoha [Fri, 18 Mar 2016 12:42:06 +0000 (13:42 +0100)]
fsadm: if available, use /proc/self/mountinfo to detect mounted volume

The /proc/self/mountinfo is not bound to device names like /proc/mounts
and it uses major:minor pairs instead.

This fixes a situation in which a volume is mounted and then renamed
later on - that makes /proc/mounts unreliable when detecting mounted
volumes.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1196910.

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.

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