]> sourceware.org Git - lvm2.git/log
lvm2.git
2 years agothin: rename internal function
Zdenek Kabelac [Wed, 24 Aug 2022 13:02:07 +0000 (15:02 +0200)]
thin: rename internal function

Names matching internal code layout.
Functionc in thin_manip.c uses thin_pool in its name.
Keep 'pool' only for function working for both cache and thin pools.

No change of functionality.

2 years agoreport: values: add note about self-decriptive values to report
Peter Rajnoha [Fri, 26 Aug 2022 12:51:31 +0000 (14:51 +0200)]
report: values: add note about self-decriptive values to report

2 years agoargs: add ARG_NONINTERACTIVE for cmds not supported in lvm shell
Peter Rajnoha [Fri, 26 Aug 2022 10:17:45 +0000 (12:17 +0200)]
args: add ARG_NONINTERACTIVE for cmds not supported in lvm shell

Certain args can't be used in lvm shell ("interactive mode") because
they are not supported there. Add ARG_NONINTERACTIVE flag to mark
such args and error out if we're in interactive mode and at the same
time we detect use of such argument.

Currently, this is the case for --reportformat arg - we don't support
changing the format per command in lvm shell. The whole shell is running
under a reportformat chosen at shell's start.

2 years agolibdm: report: fix escaping of JSON quote char in reported fields
Peter Rajnoha [Wed, 24 Aug 2022 10:08:51 +0000 (12:08 +0200)]
libdm: report: fix escaping of JSON quote char in reported fields

Commit 73ec3c954b21522352b6f5cce9a700d6bf30ccf4 added a way to print
only a part of the report string (repstr) to support decoding individual
string list items out of repstr.

The repstr is normally printed through _safe_repstr_output so that any
JSON_QUOTE character ('"') found within the repstr is escaped to not
interfere with value quoting in JSON format.

However, the commit 73ec3c954b21522352b6f5cce9a700d6bf30ccf4 missed
checking the 'len' argument passed to _safe_repstr_output function when
adding the rest of the repstr after all previous JSON_QUOTE characters
were escaped (when calling the last dm_pool_grow_object). When 'len'
is 0, we need to calculate the 'len' ourselves in the function by
simply calling strlen. This is because 'len' is passed to the function
only if we're taking a part of repstr, not as a whole.

2 years agoshell: add pre-cmd log report object type and enable lastlog for it
Peter Rajnoha [Mon, 22 Aug 2022 11:59:08 +0000 (13:59 +0200)]
shell: add pre-cmd log report object type and enable lastlog for it

If we failed or logged anything before we actually execute given command
in lvm shell, we couldn't report the log using lastlog command after.
This patch adds specific 'pre-cmd' log report object type to identify
such log messages and enables lastlog to report even this log.

2 years agodevices file: fix pvcreate --uuid matching pvid entry with no device id
David Teigland [Fri, 19 Aug 2022 18:31:22 +0000 (13:31 -0500)]
devices file: fix pvcreate --uuid matching pvid entry with no device id

pvcreate with --uuid would segfault if a devices file entry matched
the specified pvid, but the devices file entry had no device_id, which
could happen if the entry has a devname idtype.

2 years agodevices: drop double // from sysfs path
Zdenek Kabelac [Wed, 10 Aug 2022 13:09:34 +0000 (15:09 +0200)]
devices: drop double // from sysfs path

dm_sysfs_dir() comes internally as  /sys/.

2 years agodmsetup: check also for ouf of range value
Zdenek Kabelac [Thu, 18 Aug 2022 11:56:03 +0000 (13:56 +0200)]
dmsetup: check also for ouf of range value

Check errno result from strtoull().

2 years agomm: remove libaio from being skipped
Zdenek Kabelac [Thu, 18 Aug 2022 12:31:27 +0000 (14:31 +0200)]
mm: remove libaio from being skipped

Since libaio is now used also in critical section,
keep the libaio locked in memory.

2 years agovdo: extend volume and pool without flush
Zdenek Kabelac [Fri, 19 Aug 2022 12:48:01 +0000 (14:48 +0200)]
vdo: extend volume and pool without flush

When the volume size is extended, there is no need to flush
IO operations (nothing can be targeting new space yet).
VDO target is supported as target that can safely work with
this condition.

Such support is also needed, when extending VDOPOOL size
while the pool is reaching its capacity - since this allows
to continue working without reaching 'out-of-space' condition
due to flushing of all in flight IO.

2 years agovdo: reset errno before strtoull
Zdenek Kabelac [Thu, 18 Aug 2022 11:55:29 +0000 (13:55 +0200)]
vdo: reset errno before strtoull

Missed errno reset in commit ebad057579aeff0980a1b8af7eaacd56e62ed0c9.

2 years agoconfig: check for possible mempool errors in _out_line_fn
Peter Rajnoha [Wed, 17 Aug 2022 10:51:42 +0000 (12:51 +0200)]
config: check for possible mempool errors in _out_line_fn

2 years agoconfig: remove unnecessary copy of config line's space prefix before printing
Peter Rajnoha [Wed, 17 Aug 2022 08:11:05 +0000 (10:11 +0200)]
config: remove unnecessary copy of config line's space prefix before printing

When we wanted to insert '#' before a config line (to comment it out),
we used dm_pool_strndup to temporarily copy the space prefix first so
we can assemble the final line with:

   "<space_prefix># <key>=<value>":

out of original:

  "<space_prefix><key>=<value>".

The space_prefix copy is not necessary, we can just use fprintf's
precision modifier "%.*s" to print the exact part if we alrady
know space_prefix length.

2 years agolvmconfig: add --valuesonly option
Peter Rajnoha [Tue, 16 Aug 2022 14:56:06 +0000 (16:56 +0200)]
lvmconfig: add --valuesonly option

The new --valuesonly option causes the lvmconfig output to contain only
values without keys for each config node. This is practical mainly in
case where we use lvmconfig in scripts and we want to assign the value
to a different custom key or simply output the value itself without the
key.

For example:

  # lvmconfig --type full activation/raid_fault_policy
  raid_fault_policy="warn"

  # lvmconfig --type full activation/raid_fault_policy --valuesonly
  "warn"

  # my_var=$(lvmconfig --type full activation/raid_fault_policy --valuesonly)

  # echo $my_var
  "warn"

2 years agoreport: report numeric values (not string synonyms) for NUM and BIN fields with json_...
Peter Rajnoha [Mon, 15 Aug 2022 09:40:52 +0000 (11:40 +0200)]
report: report numeric values (not string synonyms) for NUM and BIN fields with json_std format

Internally, NUM and BIN fields are marked as DM_REPORT_FIELD_TYPE_NUM_NUMBER
through libdevmapper API. The new 'json_std' format mandates that the report
string representing such a value must be a number, not an arbitrary string.
This is because numeric values in 'json_std' format do not have double quotes
around them. This practically means, we can't use string synonyms
("named reserved values") for such values and the report string must always
represent a proper number.

With 'json' and 'basic' formats, this is not an issue because 'basic' format
doesn't have any structure or typing at all and 'json' format puts all values
in quotes, including numeric ones.

2 years ago_vg_read_raw_area: fix segfault caused by using null pointer
Wu Guanghao [Mon, 15 Aug 2022 14:39:02 +0000 (09:39 -0500)]
_vg_read_raw_area: fix segfault caused by using null pointer

When we tested lvm2, the kernel injected various random faults.

(gdb) bt
...
(gdb) p vg
$1 = (struct volume_group *) 0x0
(gdb) p use_previous_vg
$2 = (unsigned int *) 0x0

Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
2 years agoautoreconf: support newer archs
Zdenek Kabelac [Mon, 15 Aug 2022 09:22:53 +0000 (11:22 +0200)]
autoreconf: support newer archs

Update to more recent version of configure script to support more
new architecture types like RISCV64. Tools in use ATM:

autoconf-2.71-3.fc37.noarch
autoconf-archive-2022.02.11-3.fc37.noarch
automake-1.16.5-9.fc37.noarch

Resolves https://bugzilla.redhat.com/show_bug.cgi?id=2118243

2 years agovdo: fix --vdosettings parser
Zdenek Kabelac [Mon, 15 Aug 2022 11:14:03 +0000 (13:14 +0200)]
vdo: fix --vdosettings parser

Parser was incorrectly parsing vdo_use_features - move the skip
of 'use_' prefix into internal loop which handles skipping of '_'.

2 years agovdo: use only verbose log level for reformating
Zdenek Kabelac [Mon, 15 Aug 2022 11:08:59 +0000 (13:08 +0200)]
vdo: use only verbose log level for reformating

When lvcreate is makeing VDO pool and user has not specified -V size,
ATM we actually run  'vdoformat' twice to get properly 'extent' aligned
size matching lvm2 properties - so the 2nd. run of vdoformat actually
can stay with 'log_verbose()' so the standard printed result
is not showing confusing info (which is now also correctly using
print_unless_silent)

2 years agolvconvert: correct test support for vdo-pool
Zdenek Kabelac [Thu, 11 Aug 2022 09:44:58 +0000 (11:44 +0200)]
lvconvert: correct test support for vdo-pool

2 years agoWHATS_NEW: update
Peter Rajnoha [Thu, 11 Aug 2022 11:03:29 +0000 (13:03 +0200)]
WHATS_NEW: update

2 years agotest: add report-format test
Peter Rajnoha [Thu, 11 Aug 2022 08:57:06 +0000 (10:57 +0200)]
test: add report-format test

2 years agoreport: fix pe_start column type from NUM to SIZ
Peter Rajnoha [Fri, 5 Aug 2022 09:02:25 +0000 (11:02 +0200)]
report: fix pe_start column type from NUM to SIZ

The 'pe_start' column was incorrectly marked as being of type NUM.
This was not correct as pe_start is actually of type SIZ, which means
it can have a size suffix and hence it's not a pure numeric value.

Proper column type is important for selection to work correctly, so we
can also do comparisons while using suffixes.

This is also important for new "json_std" output format which does not
put double quotes around pure numeric values. With pe_start incorrectly
marked as NUM instead of SIZ, this produced invalid JSON output
like '"pe_start" = 1.00m' because it contained the 'm' (or other)
size suffix. If properly marked as SIZ, this is then put in double
quotes like '"pe_start" = "1.00m"'.

2 years agomake: generate
Peter Rajnoha [Fri, 5 Aug 2022 08:31:08 +0000 (10:31 +0200)]
make: generate

2 years agoman: update lvmreport man page about json_std format
Peter Rajnoha [Thu, 4 Aug 2022 14:52:22 +0000 (16:52 +0200)]
man: update lvmreport man page about json_std format

2 years agoargs: recognize 'json_std' for --reportformat cmd line arg
Peter Rajnoha [Thu, 4 Aug 2022 14:50:01 +0000 (16:50 +0200)]
args: recognize 'json_std' for --reportformat cmd line arg

2 years agoconfig: recognize 'json_std' for report/output_format config setting
Peter Rajnoha [Thu, 4 Aug 2022 14:42:54 +0000 (16:42 +0200)]
config: recognize 'json_std' for report/output_format config setting

2 years agolibdm: report: use proper JSON array for string list output in JSON_STD format
Peter Rajnoha [Thu, 4 Aug 2022 14:14:44 +0000 (16:14 +0200)]
libdm: report: use proper JSON array for string list output in JSON_STD format

In JSON format, we print string list this way:

  "key" = "item1,item2,...,itemN"

while in JSON_STD format, we print string list this way:

  "key" = ["item1","item2",...,"itemN"]

2 years agolibdm: report: separate basic and JSON+JSON_STD format in _output_field
Peter Rajnoha [Wed, 29 Jun 2022 19:59:12 +0000 (21:59 +0200)]
libdm: report: separate basic and JSON+JSON_STD format in _output_field

Use separate functions to handle basic and JSON+JSON_STD format.
It's clearer this way than interleaving both in the same function.

2 years agolibdm: report: enhance the way string list is stored internally
Peter Rajnoha [Tue, 28 Jun 2022 15:00:00 +0000 (17:00 +0200)]
libdm: report: enhance the way string list is stored internally

Before, we stored only the report string itself for a string list
in field->report_string. The field->report_string has either
sorted items or not, depending on what we need for a field -
some report fields have sorted output, some don't...

The field->sort_value.value then contains pointer to the exact
field->report_string. The field->sort_value.items ALWAYS keeps
sorted array of individual items, represented as '[position,length]'
pairs pointing to the field->sort_value.value string.

This approach was fine as far as we didn't need to apply further
formatting to field->report_string. However, if we need to apply
further formatting to field->report_string content, taking into
account individual items, we also need to know where each item
starts and what is its length. Before, we only knew this when
items in report string were sorted, but not in the unsorted version.

We can't rely on the delimiter (default ",") only to separate items
back out of report string, because that delimiter can be contained
in the item value itself.

So this patch enhances the field->report_string for a string list so
it also contains '[position,length]' pairs for each individual item
inside field->report_string. We store this array right beyond the
string itself and we encode it in the same manner we already did for
field->sort_value.items before.

If field->report_string has sorted items, the field->sort_value.items
just points to the array of items we store beyond the report string.
If field->report_string has unsorted items, we store separate array
of items for both field->report_string and field->sort_value.

This patch also cleans up the _report_field_string_list function a bit
so it's easier and more straightforward to follow than the original
version.

Example. If we have "abc", "xy", "defgh" as list on input with ","
as delimiter, then:

  - field->report_string will have:

    - if we need field->report_string unsorted:

        abc,xy,defgh\0{[3,12],[0,3],[4,2],[7,5]}
        |____________||________________________|
           string      array of [pos,len] pairs
                       |____||________________|
                       #items      items

    - if we need field->report_string sorted:

                 repstr_extra
                      |
                      V
        abc,defgh,xy\0{[3,12],[0,3],[4,5],[10,2]}
        |____________||________________________|
           string      array of [pos,len] pairs
                       |____||________________|
                       #items      items

  - field->sort_value will have:

    - if field->report_string is unsorted:

        field->sort_value.value = field->report_string
        field->sort_value.items = {[0,3],[0,3],[7,5],[4,2]}
                                    (that is 'abc,defgh,xy')

    - if field->report_string is sorted already:

        field->sort_value.value = field->report_string
        field->sort_value.items = repstr_extra
                                  (that is also 'abc,defgh,xy')

2 years agolibdm: report: use 'null' for undefined numeric values in JSON_STD output
Peter Rajnoha [Wed, 29 Jun 2022 14:00:25 +0000 (16:00 +0200)]
libdm: report: use 'null' for undefined numeric values in JSON_STD output

For JSON_STD format, use 'null' if a field has no value at all.

In JSON format, we print undefined numeric values this way:

  "key" = ""

while in JSON_STD format, we print undefined numeric values this way:

  "key" = null

(Keep in mind that 'null' is different from 0 (zero value) which is
a defined value.)

2 years agolibdm: report: remove double quotes around numeric values in JSON_STD output
Peter Rajnoha [Mon, 27 Jun 2022 07:29:55 +0000 (09:29 +0200)]
libdm: report: remove double quotes around numeric values in JSON_STD output

In JSON format, we print numeric values this way:

  "key" = "N"

while in JSON_STD format, we print numeric value this way:

  "key" = N

(Where N is a numeric value.)

2 years agolibdm: report: add DM_REPORT_GROUP_JSON_STD group
Peter Rajnoha [Thu, 4 Aug 2022 13:06:58 +0000 (15:06 +0200)]
libdm: report: add DM_REPORT_GROUP_JSON_STD group

The original JSON formatting will be still available using the original
DM_REPORT_GROUP_JSON identifier. Subsequent patches will add enhancements
to JSON formatting code so that it adheres more to JSON standard - this
will be identified by new DM_REPORT_GROUP_JSON_STD identifier.

2 years agoconfig: add correct unconfigured value for use_devicesfile
Marian Csontos [Tue, 9 Aug 2022 14:04:09 +0000 (16:04 +0200)]
config: add correct unconfigured value for use_devicesfile

2 years agospec: use --with-default-use-devices-file=1 for rhel9+
Marian Csontos [Tue, 9 Aug 2022 14:02:39 +0000 (16:02 +0200)]
spec: use --with-default-use-devices-file=1 for rhel9+

2 years agoconfigure: fix typo
Marian Csontos [Tue, 9 Aug 2022 14:01:34 +0000 (16:01 +0200)]
configure: fix typo

2 years agospec: Use libedit for newer distributions
Marian Csontos [Wed, 27 Jul 2022 16:02:01 +0000 (18:02 +0200)]
spec: Use libedit for newer distributions

2 years agoshell: also output error message about max number of args hit with JSON format
Peter Rajnoha [Mon, 8 Aug 2022 13:15:32 +0000 (15:15 +0200)]
shell: also output error message about max number of args hit with JSON format

If using JSON format for lvm shell's output, the error message about
exceeding the maximum number of arguments was not reported on output if
this condition was ever hit.

This is because the JSON format (as well as any other future format)
requires extra formatting compared to "basic" format and so it also
requires extra calls when it comes to reporting. The report needs to
be added to a report group and then popped and put on output with
specialized "dm_report_group_output_and_pop_all".

This "output and pop" is normally executed after we execute the command
in the lvm shell. When we didn't get to the command exection at all because
some precondition was not met (like hitting the limit for the number of
arguments for the command here), we skipped this important call and
so there was no log report output.

Right now, it's only this exact error message for which we need to call
"output and pop" directly, all the other error messages are about
initializing and setting the log report itself which we can't report
obviously.

Before this patch:

  lvm> pvs 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
  lvm>

With this patch applied:

  lvm> pvs 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
  {
      "log": [
          {"log_seq_num":"1", "log_type":"error", "log_context":"shell", "log_object_type":"cmd", "log_object_name":"", "log_object_id":"", "log_object_group":"", "log_object_group_id":"", "log_message":"Too many arguments, sorry.", "log_errno":"-1", "log_ret_code":"0"}
      ]
  }

If there's any other error message in the future before we execute the
command itself, we also need to call the "output and pop" directly.

2 years agoapply multipath_component_detection=0 to duplicate PV handling
David Teigland [Mon, 25 Jul 2022 18:50:43 +0000 (13:50 -0500)]
apply multipath_component_detection=0 to duplicate PV handling

multipath_component_detection=0 has always applied to the filter-based
component detection.  Also apply this setting to the duplicate-PV
handling which also eliminates multipath components (based on duplicate
PVs having the same wwid.)

2 years agomake: generate
Zdenek Kabelac [Sun, 10 Jul 2022 23:02:22 +0000 (01:02 +0200)]
make: generate

2 years agocov: restore disable_dm_devs also for error path
Zdenek Kabelac [Sat, 9 Jul 2022 00:50:08 +0000 (02:50 +0200)]
cov: restore disable_dm_devs also for error path

Keep the structure correct for failing error path,
alhtough likely this particual var will not be used.

2 years agocov: remove unused headers
Zdenek Kabelac [Sat, 9 Jul 2022 00:45:21 +0000 (02:45 +0200)]
cov: remove unused headers

2 years agovdo: suffle code for better error path handling
Zdenek Kabelac [Sat, 9 Jul 2022 19:33:57 +0000 (21:33 +0200)]
vdo: suffle code for better error path handling

For failing dm_ no need to report 2nd. error,
but we missed to report error with 'updated==NULL'.

2 years agovdo: enhance lvcreate validation
Zdenek Kabelac [Fri, 8 Jul 2022 21:38:34 +0000 (23:38 +0200)]
vdo: enhance lvcreate validation

When creating VDO pool based of  % values, lvm2 is now more clever
and avoids to create 'unsupportable' sizes of physical backend
volumes as 16TiB is maximum size supported by VDO target
(and also limited by maximum supportable slabs (8192) based on slab
size.

If the requested virtual size is approaching max supported size 4PiB,
switch header size to 0.

2 years agovdo: support v4 kernel target line
Zdenek Kabelac [Fri, 8 Jul 2022 21:35:06 +0000 (23:35 +0200)]
vdo: support v4 kernel target line

Check and use new available table line v4, if kernel supports it.

2 years agovdo: add reformating to extent size aligned virtual size
Zdenek Kabelac [Fri, 8 Jul 2022 22:42:01 +0000 (00:42 +0200)]
vdo: add reformating to extent size aligned virtual size

Newer VDO kernel target require to have matching virtual size - this
however cause incompatiblity when lvcreate is let to format VDO data
device and read the usable size from vdoformat.
Altough this is a kernel regression and will likely get fixed,
lvm2 can actually reformat VDO device to use properly aligned VDO LV
size to make this problem disappear.

2 years agovdo: check vdo memory constrains
Zdenek Kabelac [Fri, 8 Jul 2022 21:33:29 +0000 (23:33 +0200)]
vdo: check vdo memory constrains

Add function to check for avaialble memory for particular VDO
configuration - to avoid unnecessary machine swapping for configs
that will not fit into memory (possibly in locked section).

Formula tries to estimate RAM size machine can use also with
swapping for kernel target - but still leaving some amount of
usable RAM.

Estimation is based on documented RAM usage of VDO target.

If the /proc/meminfo would be theoretically unavailable, try to use
'sysinfo()' function, however this is giving only free RAM without
the knowledge about how much RAM could be eventually swapped.

TODO: move _get_memory_info() into generic lvm2 API function used
by other targets with non-trivial memory requirements.

2 years agovdo: report supported range in error path
Zdenek Kabelac [Sat, 9 Jul 2022 19:28:40 +0000 (21:28 +0200)]
vdo: report supported range in error path

2 years agovdo: use defines also for configuration defines
Zdenek Kabelac [Fri, 24 Jun 2022 13:54:08 +0000 (15:54 +0200)]
vdo: use defines also for configuration defines

Keep single source for most of values printed in lvm.conf
(still needs some conversion)

Correct max for logical threads to 60
(we may refuse some older configuration which might eventually
user higher numbers - but so far let's assume no user have ever set this
as it's been non-trivial and if would complicate code unnecessarily.)

Accept maximum of 4PiB for virtual size of VDO LV
(lvm2 will drop 'header borders to 0 for this case').

2 years agovdo: update info about memory
Zdenek Kabelac [Mon, 4 Jul 2022 13:00:26 +0000 (15:00 +0200)]
vdo: update info about memory

Add more info about kernel target memory allocation associated with
VDO pool usage.

2 years agovdo: use single validator
Zdenek Kabelac [Mon, 4 Jul 2022 14:08:30 +0000 (16:08 +0200)]
vdo: use single validator

Add era lenght validation into dm_vdo_validate_target_params()
and reuse this validator also for _check_lv_segment().

2 years agoman: space after size
Zdenek Kabelac [Mon, 4 Jul 2022 13:10:58 +0000 (15:10 +0200)]
man: space after size

Put space between size and SI unit.
Automatically make this 'space' as fixed size by Makefile sed script.

2 years agovdo: fix conversion of vdo_slab_size_mb 2nd
Zdenek Kabelac [Sun, 10 Jul 2022 23:07:24 +0000 (01:07 +0200)]
vdo: fix conversion of vdo_slab_size_mb 2nd

Patch 1b070f366ba57a6eb24df03241284732db5047e9 should have
been already fixing this issue but since it the incorrect
patch rebasing the change to vdo_slabSize got lost.
So again now with explicit one-line patch.

2 years agoexit with error when --devicesfile name doesn't exist
David Teigland [Tue, 5 Jul 2022 22:08:00 +0000 (17:08 -0500)]
exit with error when --devicesfile name doesn't exist

2 years agolvmdbustest: Add test for property "Get"
Tony Asleson [Tue, 7 Jun 2022 16:47:27 +0000 (11:47 -0500)]
lvmdbustest: Add test for property "Get"

We typically use "GetAll", so add test for "Get" and check values.

2 years agolvmdbusd: Remove try/except for mkfifo
Tony Asleson [Tue, 7 Jun 2022 13:21:03 +0000 (08:21 -0500)]
lvmdbusd: Remove try/except for mkfifo

We should never run into this error condition when using tempfile.mkdtemp.

2 years agolvmdusd: Remove non lvm JSON output support
Tony Asleson [Tue, 7 Jun 2022 13:20:06 +0000 (08:20 -0500)]
lvmdusd: Remove non lvm JSON output support

2 years agolvmdbustest: Increase number of LVs
Tony Asleson [Mon, 6 Jun 2022 15:01:18 +0000 (10:01 -0500)]
lvmdbustest: Increase number of LVs

As storage is getting faster, we need to create more LVs to pass this test.

2 years agolvmdbustest: Correct comment spelling/grammar
Tony Asleson [Mon, 6 Jun 2022 14:59:59 +0000 (09:59 -0500)]
lvmdbustest: Correct comment spelling/grammar

2 years agolvmdbustest: Test job remove path when job not complete
Tony Asleson [Mon, 6 Jun 2022 14:58:39 +0000 (09:58 -0500)]
lvmdbustest: Test job remove path when job not complete

2 years agolvmdbusd: Correct grammar in lvm shell proxy comments
Tony Asleson [Mon, 6 Jun 2022 14:57:20 +0000 (09:57 -0500)]
lvmdbusd: Correct grammar in lvm shell proxy comments

2 years agolvmdbusd: Don't require "lvm> " prompt for shell
Tony Asleson [Mon, 6 Jun 2022 14:56:32 +0000 (09:56 -0500)]
lvmdbusd: Don't require "lvm> " prompt for shell

Depending on how lvm is compiled, it may not present the "lvm> " prompt
when using the lvm shell.  Don't require it to be present.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2090391

2 years agolvmdbusd: Job prop. Get/GetAll exec. immediately
Tony Asleson [Mon, 6 Jun 2022 14:51:54 +0000 (09:51 -0500)]
lvmdbusd: Job prop. Get/GetAll exec. immediately

This allows API user the ability to check on the status of a long running
job without blocking in the request queue.

2 years agolvmdbusd: Remove the use of sub shell for lvm shell
Tony Asleson [Thu, 26 May 2022 15:44:02 +0000 (10:44 -0500)]
lvmdbusd: Remove the use of sub shell for lvm shell

This reduces the number of processes and improves security.

2 years agolvmdbusd: Fix env variable LVM_DBUSD_TEST_MODE
Tony Asleson [Wed, 25 May 2022 21:21:14 +0000 (16:21 -0500)]
lvmdbusd: Fix env variable LVM_DBUSD_TEST_MODE

Make it more logical.

2 years agolvmdbusd: Change unit test vdo minimum size
Tony Asleson [Wed, 25 May 2022 21:03:27 +0000 (16:03 -0500)]
lvmdbusd: Change unit test vdo minimum size

2 years agolvmdbusd: Add debug output for which lvm binary is used
Tony Asleson [Wed, 25 May 2022 20:59:11 +0000 (15:59 -0500)]
lvmdbusd: Add debug output for which lvm binary is used

2 years agolvmdbusd: re-work lvm shell main
Tony Asleson [Wed, 25 May 2022 20:58:15 +0000 (15:58 -0500)]
lvmdbusd: re-work lvm shell main

Add an optional single argument "bisect" to use with git bisect for
automation.  Normal case is no arguments when running stand-alone.

2 years agolvmdbusd: Simplify child process env
Tony Asleson [Wed, 25 May 2022 20:52:20 +0000 (15:52 -0500)]
lvmdbusd: Simplify child process env

We don't need to duplicate the entire env from the parent, supply only what
is needed.

2 years agolvmdbusd: Correct conditional for lvm child process running
Tony Asleson [Wed, 25 May 2022 20:51:14 +0000 (15:51 -0500)]
lvmdbusd: Correct conditional for lvm child process running

Poll returns None when process is running, else exit value.  If poll returns
0 we will fail to exit the select loop.

2 years agopvdisplay: restore --reportformat option
David Teigland [Fri, 24 Jun 2022 15:40:54 +0000 (10:40 -0500)]
pvdisplay: restore --reportformat option

Fixes commit b8f4ec846 "display: ignore --reportformat"
by restoring the --reportformat option to pvdisplay.
Adding -C to pvdisplay turns the command into a reporting
command (like pvs, vgs, lvs) in which --reportformat can
be useful.

2 years agofilter-mpath: get wwids from sysfs vpd_pg83
David Teigland [Mon, 6 Jun 2022 19:04:20 +0000 (14:04 -0500)]
filter-mpath: get wwids from sysfs vpd_pg83

to compare with wwids in /etc/multipath/wwids when
excluding multipath components.  The wwid printed
from the sysfs wwid file may not be the wwid used
in multipath wwids.  Save the wwids found for each
device on dev->wwids to avoid repeating reading
and parsing the sysfs files.

2 years agotests: skip running tests for non root user
Zdenek Kabelac [Mon, 30 May 2022 16:41:16 +0000 (18:41 +0200)]
tests: skip running tests for non root user

Testing needs 'root' privileges.
Only 'make run-unit-test' can work without them.

2 years agotests: update for wrapper
Zdenek Kabelac [Tue, 7 Jun 2022 14:52:30 +0000 (16:52 +0200)]
tests: update for wrapper

Update calling vdo manager since our vdo wrapper has a simple shell
arg parser so it needs args without '='

Also correct using  DM_DEV_DIR for 'pvcreate'

2 years agotests: add lvm_vdo_wrapper
Zdenek Kabelac [Tue, 31 May 2022 20:45:29 +0000 (22:45 +0200)]
tests: add lvm_vdo_wrapper

Introduce a replacement vdo manager wrapper for testing.
When using test suite on a system without vdo manager (which has got
deprecated) - we still need its functionality to prepare 'vdo volume'
for testing lvm_import_vdo.

Wrapper currently need 2 binaries from older 'vdo 6.2' package -
to be named:
oldvdoformat - format VDO metadata with older format
oldvdoprepareforlvm - shift vdo metadata by 1MiB

2 years agovdo: fix conversion of vdo_slab_size_mb
Zdenek Kabelac [Tue, 31 May 2022 20:48:38 +0000 (22:48 +0200)]
vdo: fix conversion of vdo_slab_size_mb

When converting VDO volume, the parameter vdo_slabSize was
incorrectly copied as vdo_blockMapCacheSize, however this parameter
is then no longer used for any table line creation so the wrong
value was only stored in metadata.

Also use just single get_kb_size_with_unit_ and remove it's duplicate
functionality with get_mb_size_with_unit_.

Use $VERB for vdo remove call.

2 years agofilter-mpath: handle other wwid types in blacklist
David Teigland [Mon, 6 Jun 2022 16:39:02 +0000 (11:39 -0500)]
filter-mpath: handle other wwid types in blacklist

Fixes commit 494372b4eed0c8f6040e3357939eb7511ac25745
  "filter-mpath: use multipath blacklist"
to handle wwids with initial type digits 1 and 2 used
for t10 and eui ids.  Originally recognized type 3 naa.

2 years agodevices file: fail if --devicesfile filename doesn't exist
David Teigland [Fri, 27 May 2022 19:27:03 +0000 (14:27 -0500)]
devices file: fail if --devicesfile filename doesn't exist

A typo of the filename after --devicesfile should result in a
command error rather than the command falling back to using no
devices file at all.  Exception is vgcreate|pvcreate which
create a new devices file if the file name doesn't exist.

2 years agodevices file: move clean up after command is run
David Teigland [Fri, 27 May 2022 17:38:43 +0000 (12:38 -0500)]
devices file: move clean up after command is run

devices_file_exit wasn't being called between lvm_shell
commands, so the file lock wouldn't be released.

2 years agopost-release
Marian Csontos [Wed, 18 May 2022 16:18:14 +0000 (18:18 +0200)]
post-release

2 years agopre-release v2_03_16
Marian Csontos [Wed, 18 May 2022 16:17:06 +0000 (18:17 +0200)]
pre-release

2 years agomake: generate
Marian Csontos [Wed, 18 May 2022 16:15:30 +0000 (18:15 +0200)]
make: generate

2 years agotoollib: fix segfault when handling selection with historical LVs
Peter Rajnoha [Thu, 5 May 2022 09:02:32 +0000 (11:02 +0200)]
toollib: fix segfault when handling selection with historical LVs

When processing historical LVs inside process_each_lv_in_vg for
selection, we need to use dummy "_historical_lv" for select_match_lv.

This is because a historical LV is not an actual LV, but only a tiny
representation with subset of original properties that we recorded
(name, uuid...).

To use the same processing functions we use for full-fledged non-historical
LVs, we need to use the prefilled "_historical_lv" structure which has all
the other missing properties hard-coded.

2 years agomake: generate
Zdenek Kabelac [Mon, 2 May 2022 11:16:25 +0000 (13:16 +0200)]
make: generate

2 years agovdo: support --vdosettings
Zdenek Kabelac [Wed, 13 Apr 2022 13:09:08 +0000 (15:09 +0200)]
vdo: support --vdosettings

Allow to use --vdosettings with lvcreate,lvconvert,lvchange.
Support settings currenly only configurable via lvm.conf.
With lvchange we require inactivate LV for changes to be applied.

Settings block_map_era_length has supported alias block_map_period.

2 years agoimprove description of devices option
David Teigland [Mon, 2 May 2022 14:46:28 +0000 (09:46 -0500)]
improve description of devices option

2 years agofilter-mpath: use multipath blacklist
David Teigland [Thu, 21 Apr 2022 18:45:01 +0000 (13:45 -0500)]
filter-mpath: use multipath blacklist

Explicit wwid's from these sections control whether the
same wwid in /etc/multipath/wwids is recognized as a
multipath component.  Other non-wwid keywords are not
used, and may require disabling the use of the multipath
wwids file in lvm.conf.

2 years agotests: devicesfile-edit.sh fix loop file name
David Teigland [Thu, 21 Apr 2022 16:31:06 +0000 (11:31 -0500)]
tests: devicesfile-edit.sh fix loop file name

don't remove dash from loop file name

2 years agodevices file: remove extraneous unlock in vgchange -u
David Teigland [Wed, 13 Apr 2022 17:16:57 +0000 (12:16 -0500)]
devices file: remove extraneous unlock in vgchange -u

vgchange -u exit path was unlocking the devices file in cases
when it wasn't needed, which produced an warning.

2 years agolvmlockd: return error from vgcreate init_vg_sanlock
David Teigland [Fri, 8 Apr 2022 16:28:53 +0000 (11:28 -0500)]
lvmlockd: return error from vgcreate init_vg_sanlock

in vgcreate for shared sanlock vg, if sanlock_write_resource
returns an unexpected error, then make init_vg_sanlock fail
which will cause the vgcreate to fail.

2 years agofilters: remove unused internal filter
David Teigland [Fri, 1 Apr 2022 20:09:18 +0000 (15:09 -0500)]
filters: remove unused internal filter

2 years agofilter: remove unused EAGAIN case and flag
David Teigland [Fri, 1 Apr 2022 20:06:03 +0000 (15:06 -0500)]
filter: remove unused EAGAIN case and flag

The case of filters returning EAGAIN and using the
FILTER_AFTER_SCAN flag is no longer used.

2 years agolvmdevices: --deldev using device id
David Teigland [Wed, 6 Apr 2022 17:29:26 +0000 (12:29 -0500)]
lvmdevices: --deldev using device id

When used with --deviceidtype, --deldev can specify
a device id to remove.

2 years agovgimportdevices: fix incorrect deviceidtype usage
David Teigland [Wed, 6 Apr 2022 17:20:26 +0000 (12:20 -0500)]
vgimportdevices: fix incorrect deviceidtype usage

When a VG has PVs with different device id types,
it would try to use the idtype of the previous PV
in the loop.  This would produce an unncessary warning,
or could lead to using the devname idtype when a better
idtype is available.

2 years agopvscan: warn about /dev/sda excluded by devices file
David Teigland [Thu, 31 Mar 2022 19:47:42 +0000 (14:47 -0500)]
pvscan: warn about /dev/sda excluded by devices file

In most installations, /dev/sda* or /dev/vda* should be included
in system.devices because the root, home, etc LVs are usually on
sda or vda.

Add a special case warning when a pvscan autoactivation command
sees that /dev/sda* or /dev/vda* are excluded by system.devices,
either not listed or having a different device id.

2 years agochange messages about filtered devices
David Teigland [Thu, 31 Mar 2022 16:38:08 +0000 (11:38 -0500)]
change messages about filtered devices

Change messages that refer to devices being "excluded by filters"
to say just "excluded".  This will avoid mistaking the word
"filters" with the lvm.conf filter setting.

2 years agolvmdevices update: correct multipath entries
David Teigland [Wed, 30 Mar 2022 21:28:35 +0000 (16:28 -0500)]
lvmdevices update: correct multipath entries

Remove multipath components.
Add multipath devs that have multipath components listed.

2 years agodevices file: warn about missing multipath entry
David Teigland [Tue, 29 Mar 2022 22:18:45 +0000 (17:18 -0500)]
devices file: warn about missing multipath entry

Warn if a scsi device is listed in the devices file that
is used by a multipath device that is not listed.  This
will happen if a scsi device is listed in the devices
file and then an mpath device is set up to use it.

The way to correct this would be to remove the devices
file entry for the component device and add a new entry
for the multipath device.

2 years agothin: fix message processing on thin-pool extension
Zdenek Kabelac [Wed, 30 Mar 2022 12:16:11 +0000 (14:16 +0200)]
thin: fix message processing on thin-pool extension

When thin-pool had queued some delete message on extension operation
such message has been 'lost' and thin-pool kernel metadata has been
left with a thin volume that no longer existed for lvm2 metadata.

2 years agofix args entry for nolocking
David Teigland [Fri, 25 Mar 2022 22:25:29 +0000 (17:25 -0500)]
fix args entry for nolocking

typo in previous commit

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