]> sourceware.org Git - lvm2.git/log
lvm2.git
8 years agolibdm: use macro for boundary test in _stats_get_extents_for_file()
Bryn M. Reeves [Fri, 8 Jul 2016 21:21:14 +0000 (22:21 +0100)]
libdm: use macro for boundary test in _stats_get_extents_for_file()

8 years agodoc: update --filemap usage in dmstats.8.in
Bryn M. Reeves [Fri, 8 Jul 2016 21:05:14 +0000 (22:05 +0100)]
doc: update --filemap usage in dmstats.8.in

8 years agodmstats: accept multiple arguments to --filemap
Bryn M. Reeves [Fri, 8 Jul 2016 21:02:47 +0000 (22:02 +0100)]
dmstats: accept multiple arguments to --filemap

Make the --filemap switch take no arguments and instead accept one
or more files on the command line to be mapped and placed into
groups.

This allows --filemap to be used with a glob:

  # dmstats create --filemap *
  rhel5.10-1.qcow2: Created new group with 87 region(s) as group ID 1564.
  rhel5.10.qcow2: Created new group with 8 region(s) as group ID 1651.
  rhel7.0-1.qcow2: Created new group with 11 region(s) as group ID 1659.
  rhel7.0.qcow2: Created new group with 1454 region(s) as group ID 1670.
  vm.img: Created new group with 2 region(s) as group ID 3124.

8 years agolibdm: use a constant for FIEMAP buffer size
Bryn M. Reeves [Fri, 8 Jul 2016 20:13:25 +0000 (21:13 +0100)]
libdm: use a constant for FIEMAP buffer size

8 years agolibdm: use SECTOR_SHIFT constant in _stats_add_extent()
Bryn M. Reeves [Fri, 8 Jul 2016 20:12:18 +0000 (21:12 +0100)]
libdm: use SECTOR_SHIFT constant in _stats_add_extent()

8 years agoman: lvconvert changes
David Teigland [Fri, 8 Jul 2016 16:55:42 +0000 (11:55 -0500)]
man: lvconvert changes

8 years agolvconvert: allow splitcache on hidden/used cache pool
David Teigland [Fri, 8 Jul 2016 19:08:55 +0000 (14:08 -0500)]
lvconvert: allow splitcache on hidden/used cache pool

lvconvert --splitcache VG/CachePool_corig

Allow the split via the hidden/used cache pool for the time being,
since the new lvconvert code did intend to allow it, but was just
missing the exception in the list of hidden LVs that were allowed.

The preferred method for splitcache is to run it on the visible
cache LV, not the hidden cache pool.  That may eventually become
the only method since we try to avoid running commands on
hidden LVs.

8 years agolvconvert: don't show aliases in error output
David Teigland [Fri, 8 Jul 2016 18:29:19 +0000 (13:29 -0500)]
lvconvert: don't show aliases in error output

We want to consistently use the standard command form.
The aliases are now mentioned in the man page for reference.

8 years agodmstats: use canonical path when reporting errors
Bryn M. Reeves [Fri, 8 Jul 2016 16:06:35 +0000 (17:06 +0100)]
dmstats: use canonical path when reporting errors

When a 'dmstats create --filemap' operation fails (e.g. during
open(2), close(2), or dm_stats_create_regions_from_fd()), use the
canonical version of the path. This avoids cryptic/confusing error
messages when symbolic links exist in the path argument given:

  # findmnt /var/lib/libvirt/images -otarget,source
  TARGET                  SOURCE
  /var/lib/libvirt/images /dev/mapper/vg_hex-lv_images

  # readlink /var/lib/libvirt/images/my.img
  /boot/my.img

  # dmstats create --filemap /var/lib/libvirt/images/my.img
  Cannot map file: not a device-mapper device.
  Could not create regions from file /var/lib/libvirt/images/my.img
  Command failed

Using the canonical path the error is immediately obvious:

  # dmstats create --filemap /var/lib/libvirt/images/my.img
  Cannot map file: not a device-mapper device.
  Could not create regions from file /boot/my.img
  Command failed

8 years agodoc: remove obsolete --statstype references from dmstats.8.in
Bryn M. Reeves [Thu, 7 Jul 2016 14:23:07 +0000 (15:23 +0100)]
doc: remove obsolete --statstype references from dmstats.8.in

8 years agoWHATS_NEW_DM: add --segments grouping and resource leak fix
Bryn M. Reeves [Thu, 7 Jul 2016 13:37:49 +0000 (14:37 +0100)]
WHATS_NEW_DM: add --segments grouping and resource leak fix

8 years agodoc: mention --segments grouping in dmstats.8.in
Bryn M. Reeves [Thu, 7 Jul 2016 14:10:07 +0000 (15:10 +0100)]
doc: mention --segments grouping in dmstats.8.in

8 years agodmstats: group regions by default with --segments
Bryn M. Reeves [Thu, 7 Jul 2016 12:53:06 +0000 (13:53 +0100)]
dmstats: group regions by default with --segments

Grouping is also useful in combination with --segments: creating a
group allows both individual segment data and data for the device
as a whole to be presented in the same report.

Support grouping for 'create --segments' in the same manner as for
'create --filemap'; group regions by default, applying an optional
alias specified with --alias, unless the user specifies --nogroup.

8 years agoWHATS_NEW_DM: add --filemap and histogram aggregation
Bryn M. Reeves [Thu, 7 Jul 2016 08:51:54 +0000 (09:51 +0100)]
WHATS_NEW_DM: add --filemap and histogram aggregation

8 years agodmstats: allow --bounds with 'create --filemap'
Bryn M. Reeves [Thu, 7 Jul 2016 08:48:09 +0000 (09:48 +0100)]
dmstats: allow --bounds with 'create --filemap'

8 years agolibdm: enable creation of filemap regions with histograms
Bryn M. Reeves [Thu, 7 Jul 2016 08:47:19 +0000 (09:47 +0100)]
libdm: enable creation of filemap regions with histograms

8 years agodoc: mention group histogram restrictions in dmstats.8.in
Bryn M. Reeves [Mon, 4 Jul 2016 11:49:14 +0000 (12:49 +0100)]
doc: mention group histogram restrictions in dmstats.8.in

8 years agolibdm: allow regions with histograms in dm_stats_create_group()
Bryn M. Reeves [Sun, 3 Jul 2016 21:55:33 +0000 (22:55 +0100)]
libdm: allow regions with histograms in dm_stats_create_group()

Allow regions with histograms to be grouped if all histograms have
the same number of bins and matching bounds.

8 years agolibdm: add aggregation support to dm_stats_get_histogram()
Bryn M. Reeves [Sun, 3 Jul 2016 20:59:31 +0000 (21:59 +0100)]
libdm: add aggregation support to dm_stats_get_histogram()

Support aggregate group and region histograms by allocating a new
histogram from the pool and populating it with a sum of the histogram
data for the areas contained in the region or group.

To avoid repeatedly summing the same histogram data, cache the pointer
in the group and regions structs for subsequent access. The aggregate
histograms are allocated from the same pool as the area histograms in
the corresponding handle and will be discarded at each list or populate
operation.

8 years agodoc: update dmstats.8.in for --filemap and --nogroup dev-bmr-dmstats-filemap
Bryn M. Reeves [Fri, 1 Jul 2016 20:41:25 +0000 (21:41 +0100)]
doc: update dmstats.8.in for --filemap and --nogroup

8 years agodmstats: add create --filemap
Bryn M. Reeves [Thu, 30 Jun 2016 20:48:10 +0000 (21:48 +0100)]
dmstats: add create --filemap

Add a new option to the create command to create regions that map the
extents of a file:

  # dmstats create --filemap /path/to/file
  /path/to/file: Created new group with 10 region(s) as group ID 0.

When performing a --filemap no device argument is required (and
supplying one results in error) since the device to bind to is implied
by the file path and is obtained directly from an fstat().

Grouping may be optionally disabled by the --nogroup switch: in this
case the command will report each region individually:

  # dmstats create --nogroup --filemap /path/to/file
  /path/to/file: Created new region with 1 area as region ID 0.
  /path/to/file: Created new region with 1 area as region ID 1.
  /path/to/file: Created new region with 1 area as region ID 2.

When grouping regions the group alias is automatically set to the
basename (as returned by dm_basename()) of the provided file.

This can be overridden to a user-defined value at the command line by
use of the --alias option.

If grouping is disabled no alias can be set.

Use of offset and subdivision options (--start, --length, --segments,
--areas, --areasize).

Setting aux_data and histograms for groups is possible but is not
currently implemented.

8 years agolibdm: add dm_stats_create_regions_from_fd()
Bryn M. Reeves [Thu, 30 Jun 2016 20:46:43 +0000 (21:46 +0100)]
libdm: add dm_stats_create_regions_from_fd()

Add a call to create dmstats regions that correspond to the extents
present in a file descriptor open on a file in a local file system.
The file must reside on a file system type that correctly supports
physical extent location data in the FIEMAP ioctl.

Regions are optionally placed into a group with a user-defined alias.

File systems that do not support physical offsets in FIEMAP (btrfs
currently) are detected via fstatfs() - although attempting to map
a --filemap group on btrfs will fail anyway with the generic error
"Not on a device-mapper device" this is confusing; the file system
mount is on a device-mapper device, but btrfs' volume layer masks
this in the returned st_dev field since the returned logical file
extents may span multiple physical devices.

8 years agoman: enhance lvconvert
Heinz Mauelshagen [Fri, 8 Jul 2016 13:18:18 +0000 (15:18 +0200)]
man: enhance lvconvert

8 years agolibdm: fix group resource leak in dm_stats_delete_region()
Bryn M. Reeves [Thu, 7 Jul 2016 12:45:06 +0000 (13:45 +0100)]
libdm: fix group resource leak in dm_stats_delete_region()

The function _stats_remove_region_id_from_group() incorecctly set
the group_id to DM_STATS_GROUP_NOT_PRESENT _before_ the call to
_stats_group_destroy(). This will cause the destroy function to
return immediately without doing anything:

 339 static void _stats_group_destroy(struct dm_stats_group *group)
 340 {
 341         if (!_stats_group_present(group))
 342                 return;

Invalidating the ID in _stats_region_region_id_from_group() is
redundant anyway; it is rightly done as the last operation in
_stats_group_destroy (and it is not possible for anything to see
the old value between the two calls).

Remove the change to group_id to ensure that the alias and bitset
resources are correctly freed.

8 years agodmstats: ensure dm_stats_delete_region() return is checked
Bryn M. Reeves [Fri, 8 Jul 2016 10:46:13 +0000 (11:46 +0100)]
dmstats: ensure dm_stats_delete_region() return is checked

8 years agolibdm: improve comments in stats grouping functions
Bryn M. Reeves [Fri, 8 Jul 2016 10:05:38 +0000 (11:05 +0100)]
libdm: improve comments in stats grouping functions

Add more detailed comments to dm_stats_create_group() and
_stats_group_check_overlap().

8 years agolibdm: fix resource leak in dm_stats_set_alias()
Bryn M. Reeves [Fri, 8 Jul 2016 09:51:19 +0000 (10:51 +0100)]
libdm: fix resource leak in dm_stats_set_alias()

When we fail to update aux_data the newly allocated group->alias must
be freed before reinstating old_alias.

8 years agolibdm: enclose dm_stats_walk_do/while() body in do..while
Bryn M. Reeves [Thu, 7 Jul 2016 20:28:35 +0000 (21:28 +0100)]
libdm: enclose dm_stats_walk_do/while() body in do..while

The call to dm_stats_walk_start() before the do statement makes
dm_stats_walk_do() behave inconsistently depending on context;
wrap them in an additional do { } while (0) so that the macro
always expands to a valid statement.

8 years agoman: more lvcreate size rewording
David Teigland [Thu, 7 Jul 2016 22:21:05 +0000 (17:21 -0500)]
man: more lvcreate size rewording

8 years agoman: rewrite lvconvert
David Teigland [Wed, 6 Jul 2016 20:26:56 +0000 (15:26 -0500)]
man: rewrite lvconvert

Based on the new enumeration of all possible commands.

8 years agoman: more rewording for lvcreate size
David Teigland [Thu, 7 Jul 2016 18:11:43 +0000 (13:11 -0500)]
man: more rewording for lvcreate size

8 years agolvconvert: allow converting type raid1 to type linear
David Teigland [Wed, 6 Jul 2016 21:44:18 +0000 (16:44 -0500)]
lvconvert: allow converting type raid1 to type linear

The code could perform this conversion but ironically
did not recognize the standard command form, only the
the unpreferred "implication-based" command form.

"lvconvert --type linear VG/RaidLV" would fail, but
"lvconvert --mirrors 0 VG/RaidLV" would succeed.

8 years agolvconvert: allow converting type mirror to type linear
David Teigland [Wed, 6 Jul 2016 21:33:25 +0000 (16:33 -0500)]
lvconvert: allow converting type mirror to type linear

The code could perform this conversion but ironically
did not recognize the standard command form, only the
the unpreferred "implication-based" command form.

"lvconvert --type linear VG/MirrorLV" would fail, but
"lvconvert --mirrors 0 VG/MirrorLV" would succeed.

8 years agovgcreate: allow pvcreate force option
David Teigland [Wed, 6 Jul 2016 19:10:53 +0000 (14:10 -0500)]
vgcreate: allow pvcreate force option

Commit a9940bd3c92 began disallowing the -f (force) option
to apply to the implicit pvcreate.  Make it allowed again.

8 years agoman: clarify lvcreate size in extents
David Teigland [Wed, 6 Jul 2016 16:35:50 +0000 (11:35 -0500)]
man: clarify lvcreate size in extents

8 years agopost-release
Alasdair G Kergon [Wed, 6 Jul 2016 16:04:25 +0000 (17:04 +0100)]
post-release

8 years agopre-release v2_02_160
Alasdair G Kergon [Wed, 6 Jul 2016 15:55:44 +0000 (16:55 +0100)]
pre-release

8 years agolibdm: check for empty aux_data in _parse_aux_data_group()
Bryn M. Reeves [Wed, 6 Jul 2016 15:29:06 +0000 (16:29 +0100)]
libdm: check for empty aux_data in _parse_aux_data_group()

If after extracting stats arguments and group tags nothing remains
of aux_data but '-' set the region->aux_data field to the empty
string to match behaviour for non-grouped regions.

8 years agocoverity: Fixes for recent changes.
Alasdair G Kergon [Wed, 6 Jul 2016 15:09:32 +0000 (16:09 +0100)]
coverity: Fixes for recent changes.

8 years agolibdm: use log_err_once() for group histogram message
Bryn M. Reeves [Wed, 6 Jul 2016 10:16:12 +0000 (11:16 +0100)]
libdm: use log_err_once() for group histogram message

8 years agolibdm: do not permit grouping regions with histograms
Bryn M. Reeves [Wed, 6 Jul 2016 10:10:23 +0000 (11:10 +0100)]
libdm: do not permit grouping regions with histograms

Although not harmful do not allow a group containing regions with
histograms since it is not currently possible to present histogram
data aggregated for the group.

8 years agodmstats: simplify nr_areas calculation (CWE-561)
Bryn M. Reeves [Mon, 4 Jul 2016 18:25:40 +0000 (19:25 +0100)]
dmstats: simplify nr_areas calculation (CWE-561)

Eliminate dead conditional (step cannot be zero).

Fixes commit 988ca74.

8 years agodmstats: fix 'obj_type' field width
Bryn M. Reeves [Wed, 6 Jul 2016 08:37:59 +0000 (09:37 +0100)]
dmstats: fix 'obj_type' field width

The header for 'obj_type' was changed from 'Object Type' to
'ObjType': update the minimum field width to match this change.

8 years agolibdm: check non-zero io count in _average_{rd,wr}_wait_time (Coverity)
Bryn M. Reeves [Wed, 6 Jul 2016 08:20:05 +0000 (09:20 +0100)]
libdm: check non-zero io count in _average_{rd,wr}_wait_time (Coverity)

Although a non-zero value for the number of ticks spent doing IO
should imply a non-zero number of IOs in the interval test for
this explicitly to avoid a divide-by-zero in the event of bad
counter data.

8 years agolibdm: test for zero interval_ns in _utilization() (Coverity)
Bryn M. Reeves [Wed, 6 Jul 2016 08:12:51 +0000 (09:12 +0100)]
libdm: test for zero interval_ns in _utilization() (Coverity)

It's possible for interval_ns to be zero if the interval is not
set or the clock is misconfigured. Test for this before using the
value as the divisor in the utilisation calculation.

8 years agolibdm: restore missing braces in _stats_walk_end_areas
Bryn M. Reeves [Wed, 6 Jul 2016 08:04:13 +0000 (09:04 +0100)]
libdm: restore missing braces in _stats_walk_end_areas

Jumping to the end of the region table must only happen if there
are no more present, non-skipped regions, and no group walk is
configured to begin.

8 years agolibdm: fix mask leak in dm_bitset_parse_list
Bryn M. Reeves [Wed, 6 Jul 2016 07:59:09 +0000 (08:59 +0100)]
libdm: fix mask leak in dm_bitset_parse_list

If an unexpected '-' is found jump to the error branch so that the
mask is properly freed before returning.

8 years agopost-release
Alasdair G Kergon [Wed, 6 Jul 2016 00:14:33 +0000 (01:14 +0100)]
post-release

8 years agopre-release v2_02_159
Alasdair G Kergon [Tue, 5 Jul 2016 23:59:28 +0000 (00:59 +0100)]
pre-release

8 years agovgsplit: Don't skip moving internal snapshot LV.
Alasdair G Kergon [Tue, 5 Jul 2016 22:08:14 +0000 (23:08 +0100)]
vgsplit: Don't skip moving internal snapshot LV.

Also place snapshot LV handling back at the end, after all possible
origin and cow LVs got dealt with.

8 years agolibdm: cast walk flags to uint64_t when logging.
Bryn M. Reeves [Tue, 5 Jul 2016 19:45:24 +0000 (20:45 +0100)]
libdm: cast walk flags to uint64_t when logging.

Walk flags are ULL constants; cast the result to a uint64_t before
logging with a FMTx64 format specifier to avoid a compiler warning:

  warning: format â€˜%lx’ expects argument of type â€˜long unsigned int’,
  but argument 5 has type â€˜long long unsigned int’

8 years agolibdm: ensure flags constants have ULL suffix
Bryn M. Reeves [Tue, 5 Jul 2016 19:21:49 +0000 (20:21 +0100)]
libdm: ensure flags constants have ULL suffix

The walk flags used by libdm-stats use the upper portion of a 64b
value: use the ULL suffix to ensure the compiler knows the expected
size.

8 years agodoc: document --area, --region, and --group in dmstats.8.in
Bryn M. Reeves [Tue, 5 Jul 2016 18:28:19 +0000 (19:28 +0100)]
doc: document --area, --region, and --group in dmstats.8.in

8 years agodmstats: fix <backtrace> in _display_info_cols()
Bryn M. Reeves [Tue, 5 Jul 2016 17:42:29 +0000 (18:42 +0100)]
dmstats: fix <backtrace> in _display_info_cols()

Remove a false <backtrace> in _display_info_cols(): it is not an
error if there are no regions to display.

Fixes commit e6724f03.

8 years agolibdm: fix <backtrace> in dm_stats_populate
Bryn M. Reeves [Tue, 5 Jul 2016 17:34:14 +0000 (18:34 +0100)]
libdm: fix <backtrace> in dm_stats_populate

8 years agolibdm: fix <backtrace> in dm_stats_get_nr_regions
Bryn M. Reeves [Tue, 5 Jul 2016 17:33:02 +0000 (18:33 +0100)]
libdm: fix <backtrace> in dm_stats_get_nr_regions

8 years agodmstats: rename --auxdata to --userdata
Bryn M. Reeves [Tue, 5 Jul 2016 14:54:02 +0000 (15:54 +0100)]
dmstats: rename --auxdata to --userdata

8 years agodmstats: rename 'aux_data' to 'user_data'
Bryn M. Reeves [Tue, 5 Jul 2016 14:30:31 +0000 (15:30 +0100)]
dmstats: rename 'aux_data' to 'user_data'

Make it clear that the "aux data" presented in reports is the user
data stored in the field (and does not include any library-internal
state such as group descriptors) by renaming the field to user_data
and changing the heading to "UserData".

8 years agolibdm: clarify library's use of aux_data
Bryn M. Reeves [Tue, 5 Jul 2016 14:17:44 +0000 (15:17 +0100)]
libdm: clarify library's use of aux_data

Make it clear in libdevmapper.h, and in function argument names, that
libdm-stats uses the aux_data field internally and that any values set
for user_data are appended to the library values before being stored
with a region, and similarly, that internal data fields will be stripped
prior to returning any previously stored user_data.

8 years agodmstats: replace --statstype with separate object switches
Bryn M. Reeves [Tue, 5 Jul 2016 13:08:28 +0000 (14:08 +0100)]
dmstats: replace --statstype with separate object switches

Replace --statstype=area,region,group with a separate switch for
each object type: --area, --region, --group. Omitting any object
type switch will use the defaults for the current command (regions
and groups for list, and regions, groups and areas for verbose list).

8 years agodmstats: add 'statsname' and 'obj_type' to default stats fields
Bryn M. Reeves [Tue, 5 Jul 2016 11:29:13 +0000 (12:29 +0100)]
dmstats: add 'statsname' and 'obj_type' to default stats fields

8 years agodmstats: rename 'type' field to 'obj_type'
Bryn M. Reeves [Tue, 5 Jul 2016 11:27:46 +0000 (12:27 +0100)]
dmstats: rename 'type' field to 'obj_type'

Rename the field and remove whitespace from the column heading:

  "Object Type" -> "ObjType"

8 years agodmstats: use 'statsname' and 'groupid' in default fields
Bryn M. Reeves [Tue, 5 Jul 2016 11:10:47 +0000 (12:10 +0100)]
dmstats: use 'statsname' and 'groupid' in default fields

Replace the 'name' field with 'statsname' in order to report alias
names for groups, and include the 'group_id' field between statsname
and the 'region_id' field to make it clear to the user when groups
are in use.

8 years agodmstats: convert 'delete' to dm_stats_foreach_region()
Bryn M. Reeves [Tue, 5 Jul 2016 10:26:24 +0000 (11:26 +0100)]
dmstats: convert 'delete' to dm_stats_foreach_region()

8 years agodmstats: convert 'print' to dm_stats_foreach_region()
Bryn M. Reeves [Tue, 5 Jul 2016 10:09:38 +0000 (11:09 +0100)]
dmstats: convert 'print' to dm_stats_foreach_region()

8 years agodmstats: convert 'clear' to dm_stats_foreach_region()
Bryn M. Reeves [Tue, 5 Jul 2016 09:54:23 +0000 (10:54 +0100)]
dmstats: convert 'clear' to dm_stats_foreach_region()

8 years agodoc: update dmstats.8.in for groups
Bryn M. Reeves [Wed, 22 Jun 2016 17:36:10 +0000 (18:36 +0100)]
doc: update dmstats.8.in for groups

8 years agodmstats: fix region deletion message
Bryn M. Reeves [Fri, 1 Jul 2016 13:18:38 +0000 (14:18 +0100)]
dmstats: fix region deletion message

Make the use of 64-bit format macros consistent with other usage
and end the message with a '.'.

8 years agodmstats: accept --groupid for 'dmstats delete'
Bryn M. Reeves [Fri, 1 Jul 2016 12:15:43 +0000 (13:15 +0100)]
dmstats: accept --groupid for 'dmstats delete'

Allow deletion of a group and all the regions it contains with a
single 'dmstats delete' command.

8 years agodmstats: allow --statstype to override report defults
Bryn M. Reeves [Wed, 29 Jun 2016 09:19:28 +0000 (10:19 +0100)]
dmstats: allow --statstype to override report defults

8 years agodmstats: report a list of members as a group's region_id
Bryn M. Reeves [Sun, 19 Jun 2016 20:01:50 +0000 (21:01 +0100)]
dmstats: report a list of members as a group's region_id

Instead of '-' print the member list in range notation (as stored
in aux_data).

8 years agodmstats: report groups and region summaries
Bryn M. Reeves [Sun, 19 Jun 2016 12:38:41 +0000 (13:38 +0100)]
dmstats: report groups and region summaries

Walk avaiable groups and regions (in addition to areas) and report
aggregate statistics and properties.

A new switch is added to filter the type of obects inclued in the
report:

  --statstype={all,area,region,group}

The type of the current row is also available in a new
DR_STATS_META field 'type'.

8 years agodmstats: do not walk regions if deleting a single id
Bryn M. Reeves [Sun, 19 Jun 2016 13:40:03 +0000 (14:40 +0100)]
dmstats: do not walk regions if deleting a single id

8 years agodmstats: add stats_name field
Bryn M. Reeves [Mon, 13 Jun 2016 13:28:37 +0000 (14:28 +0100)]
dmstats: add stats_name field

To allow the names used to describe statistics report objects to
change (for e.g to support groups and region and group aliases)
introduce a new "stats_name" field that evaluates to the correct
name for the object being reported.

8 years agodmstats: add group alias support
Bryn M. Reeves [Mon, 7 Mar 2016 18:16:22 +0000 (18:16 +0000)]
dmstats: add group alias support

8 years agodmstats: add 'group' and 'ungroup' commands
Bryn M. Reeves [Mon, 7 Mar 2016 18:07:57 +0000 (18:07 +0000)]
dmstats: add 'group' and 'ungroup' commands

Add a pair of commands to create and delete stats groups:

  dmstats group --regions REGIONS

  dmstats ungroup --groupid ID

REGIONS specifies a list of regions to be included in the group.
Regions are specified as a comma separated list in order of
increasing region ID. Ranges may be specified as a hypen separated
pair of values giving the first and last member of the range.

8 years agodmstats: add group_id report field type
Bryn M. Reeves [Mon, 7 Mar 2016 18:01:45 +0000 (18:01 +0000)]
dmstats: add group_id report field type

8 years agolibdm: allow deleting regions with dm_stats_delete_group()
Bryn M. Reeves [Fri, 1 Jul 2016 12:14:41 +0000 (13:14 +0100)]
libdm: allow deleting regions with dm_stats_delete_group()

Add a flag to dm_stats_delete_group() to allow optional deletion
of all regions belonging to the group being removed.

8 years agolibdm: add stats group and region iterators and properties
Bryn M. Reeves [Sun, 19 Jun 2016 12:30:46 +0000 (13:30 +0100)]
libdm: add stats group and region iterators and properties

Add support do dm_stats_walk*() to walk over the set of
available groups using the cursor embedded in the dm_stats
handle, and to obtain the type of the object at the current
stats cursor location. A set of flags is introduced to
control which objects are visited:

    DM_STATS_WALK_AREA
    DM_STATS_WALK_REGION
    DM_STATS_WALK_GROUP
    DM_STATS_WALK_ALL

A final flag suppresses visits to regions that contain only a
single area - since the aggregate of such a region is idential
to the area it contains this allows these duplicates to be
filtered out:

    DM_STATS_WALK_SKIP_SINGLE_AREA

If flags are not initialised before beginning a walk the default
set matches the behaviour of previous versions of the library.

Also accept group identifiers as immediate arguments to the
counter, metric, and property functions by adding control
flags to the region and area identifiers passed in.

Region and area properties are mapped to their equivalents for
the group (for example: group size is reported as the sum of
all regions contained in the group). Counter and metric values
are aggregated for the region or group.

8 years agolibdm: use defined constants for buffer sizes
Bryn M. Reeves [Thu, 16 Jun 2016 18:40:43 +0000 (19:40 +0100)]
libdm: use defined constants for buffer sizes

Introduce constants for the buffer sizes that libdm-stats uses:
one for messages sent to the kernel, one for rows of response data
returned, and a pair for the "start+len" range and histogram bounds
strings.

8 years agolibdm: add statistics groups
Bryn M. Reeves [Mon, 29 Feb 2016 17:52:29 +0000 (17:52 +0000)]
libdm: add statistics groups

Add a grouping facility to the libdm-stats library that allows the
user to bind several regions together as a group. Groups may be
used to aggregate data from several regions for reporting, or to
select and sort among large sets of regions.

A textual descriptor ("group tag") is associated with each group
and is stored in the first group member's aux_data field. The
tag contains the group member list and an optional alias for the
group, allowing the user to assign meaningful names to groups of
regions.

These descriptors are parsed in @stats_list message responses and
populate the resulting region and area tables with the group
structure.

Groups with overlapping regions are permitted but since this will
result in some events being counted more than once a warning is
printed in this case.

Nested and overlapping groups are not currently supported and
attempting to create these configurations results in error.

8 years agolibdm: rename 'region' to 'skip_region' in _stats_walk_next
Bryn M. Reeves [Mon, 20 Jun 2016 16:12:38 +0000 (17:12 +0100)]
libdm: rename 'region' to 'skip_region' in _stats_walk_next

In libdm-stats.c 'region' usually refers to a 'struct region*'.
Rename the argument to _stats_walk_start to avoid confusion.

8 years agolibdm: add enum based counter and metric calls
Bryn M. Reeves [Mon, 29 Feb 2016 17:33:16 +0000 (17:33 +0000)]
libdm: add enum based counter and metric calls

Add a new enum based interface for accessing counter and metric
values that uses a single function for each:

uint64_t dm_stats_get_counter(const struct dm_stats *dms,
                              dm_stats_counter_t counter
                              uint64_t region_id, uint64_t area_id);

int dm_stats_get_metric(const struct dm_stats *dms, int metric,
                        uint64_t region_id, uint64_t area_id,
                        double *value);

This simplifies the implementation of value aggregation for
groups of regions. The named function interface now calls the
enum interface internally so that all new functionality is
available regardless of the method used to retrieve values.

8 years agolibdm: cache dm name in stats handle
Bryn M. Reeves [Fri, 17 Jun 2016 11:17:33 +0000 (12:17 +0100)]
libdm: cache dm name in stats handle

Cache the device-mapper name of a bound device in the dm_stats
handle.

This will be used by stats groups to report a device name or
user defined alias for groups.

8 years agolibdm: rename dm_stats name, devno and uuid members
Bryn M. Reeves [Thu, 10 Mar 2016 16:51:02 +0000 (16:51 +0000)]
libdm: rename dm_stats name, devno and uuid members

The device-mapper name, device numbers and uuid stored in the
dm_stats handle are used only to bind the handle to a specific
device in order to issue ioctls.

Rename them to "bind_*" to reflect this usage in preparation
for caching the device-mapper name of the bound device in the
dm_stats handle.

This will be used to allow optional aliases to be set for
dmstats groups.

8 years agolibdm: add dm_bitset_parse_list()
Bryn M. Reeves [Thu, 18 Feb 2016 16:14:43 +0000 (16:14 +0000)]
libdm: add dm_bitset_parse_list()

Add a function to parse a list of integer values and ranges into
a dm_bitset representation. Individual values signify that that bit
is set in the resulting mask and ranges are given as a pair of
start and end values, M-N, such that M and N are the first and
last members of the range (inclusive).

The implementation is based on the kernel's __bitmap_parselist()
that is used for cpumasks and other set configuration passed in
string form from user space.

8 years agolibdm: fix histogram pool user-after-free (CWE-825)
Bryn M. Reeves [Mon, 4 Jul 2016 17:20:09 +0000 (18:20 +0100)]
libdm: fix histogram pool user-after-free (CWE-825)

8 years agovgsplit: fix moving RAID LVs to split off VG and check for LVs not to skip moving...
Heinz Mauelshagen [Tue, 5 Jul 2016 13:39:57 +0000 (15:39 +0200)]
vgsplit: fix moving RAID LVs to split off VG and check for LVs not to skip moving with other LV types

8 years agotests: using mkfs config file
Zdenek Kabelac [Mon, 4 Jul 2016 15:39:17 +0000 (17:39 +0200)]
tests: using  mkfs config file

Use more predictable local config when creating ext4.

8 years agotests: add line for mixing dmeventd with log
Zdenek Kabelac [Mon, 4 Jul 2016 15:32:58 +0000 (17:32 +0200)]
tests: add line for mixing dmeventd with log

TODO: it might be better to log dmeventd messages with test output
just like we do with clvmd - maybe we will switch to this one
instead of extra  DMEVENTD log file in future....

8 years agotests: add mke2fs.conf
Zdenek Kabelac [Mon, 4 Jul 2016 15:28:43 +0000 (17:28 +0200)]
tests: add mke2fs.conf

Add config for mkfs to get more predicatable results
when using mkfs across variety of distributions.

In future maybe use this per all tests as default.
For now user has to specify in a test MKE2FS_CONFIG envvar to use it.

8 years agotests: try to force remove higher minor first
Zdenek Kabelac [Mon, 4 Jul 2016 13:39:44 +0000 (15:39 +0200)]
tests: try to force remove higher minor first

When force removing thin-pool we loose 'real' access to hidden device,
and if such pool is in suspended state, any thin volume cannot be
dropped. It likely should be also checked by dmsetup, but meanwhile
apply simple logic -  try to force remove first all higher minors first
with assumption we first create thin-pool and then thin volume
and there are usually not being released lower dm numbers to
get the order wrong.

8 years agocleanup: drop unused header files
Zdenek Kabelac [Mon, 4 Jul 2016 13:37:31 +0000 (15:37 +0200)]
cleanup: drop unused header files

8 years agodmeventd: improved logged messages from thin plugin
Zdenek Kabelac [Mon, 4 Jul 2016 15:30:27 +0000 (17:30 +0200)]
dmeventd: improved logged messages from thin plugin

Show better names in logged messages.

8 years agodmsetup: fix timestamp leak
Bryn M. Reeves [Wed, 29 Jun 2016 09:14:57 +0000 (10:14 +0100)]
dmsetup: fix timestamp leak

With a single report (--count=1) no timerfd is set up and the cycle
and current timestamps should be freed during the single call to
_update_interval_times().

8 years agodmstats: fix RgStart and RgSize field widths
Bryn M. Reeves [Mon, 27 Jun 2016 11:41:58 +0000 (12:41 +0100)]
dmstats: fix RgStart and RgSize field widths

8 years agodocs: remove obsolete note from dmstats.8.in
Bryn M. Reeves [Sun, 19 Jun 2016 20:48:29 +0000 (21:48 +0100)]
docs: remove obsolete note from dmstats.8.in

8 years agoraid0: Add raid0_meta segment type.
Alasdair G Kergon [Fri, 1 Jul 2016 21:20:54 +0000 (22:20 +0100)]
raid0: Add raid0_meta segment type.

8 years agolvconvert: improve arg checks in new operation routing code
David Teigland [Fri, 1 Jul 2016 15:18:05 +0000 (10:18 -0500)]
lvconvert: improve arg checks in new operation routing code

Use defines for segment types, and test args directly
instead of indirectly.

8 years agotests: test foreign users of thin-pool
Zdenek Kabelac [Thu, 30 Jun 2016 14:21:03 +0000 (16:21 +0200)]
tests: test foreign users of thin-pool

Note: dmeventd should not need any notification and automatically
try to resize again when there is some metadata change.

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