]> sourceware.org Git - lvm2.git/log
lvm2.git
2 years agoconfigure: update
Marian Csontos [Wed, 14 Sep 2022 13:16:30 +0000 (15:16 +0200)]
configure: update

2 years agotests: skip new lvresize tests when missing new libblkid
David Teigland [Tue, 13 Sep 2022 20:37:10 +0000 (15:37 -0500)]
tests: skip new lvresize tests when missing new libblkid

2 years agolvresize: add new options and defaults for fs handling
David Teigland [Tue, 14 Jun 2022 20:20:21 +0000 (15:20 -0500)]
lvresize: add new options and defaults for fs handling

The new option "--fs String" for lvresize/lvreduce/lvextend
controls the handling of file systems before/after resizing
the LV.  --resizefs is the same as --fs resize.

The new option "--fsmode String" can be used to control
mounting and unmounting of the fs during resizing.

Possible --fs values:

checksize
  Only applies to reducing size; does nothing for extend.
  Check the fs size and reduce the LV if the fs is not using
  the affected space, i.e. the fs does not need to be shrunk.
  Fail the command without reducing the fs or LV if the fs is
  using the affected space.

resize
  Resize the fs using the fs-specific resize command.
  This may include mounting, unmounting, or running fsck.
  See --fsmode to control mounting behavior, and --nofsck to
  disable fsck.

resize_fsadm
  Use the old method of calling fsadm to handle the fs
  (deprecated.) Warning: this option does not prevent lvreduce
  from destroying file systems that are unmounted (or mounted
  if prompts are skipped.)

ignore
  Resize the LV without checking for or handling a file system.
  Warning: using ignore when reducing the LV size may destroy the
  file system.

Possible --fsmode values:

manage
  Mount or unmount the fs as needed to resize the fs,
  and attempt to restore the original mount state at the end.

nochange
  Do not mount or unmount the fs. If mounting or unmounting
  is required to resize the fs, then do not resize the fs or
  the LV and fail the command.

offline
  Unmount the fs if it is mounted, and resize the fs while it
  is unmounted. If mounting is required to resize the fs,
  then do not resize the fs or the LV and fail the command.

Notes on lvreduce:

When no --fs or --resizefs option is specified:
. lvextend default behavior is fs ignore.
. lvreduce default behavior is fs checksize
  (includes activating the LV.)

With the exception of --fs resize_fsadm|ignore, lvreduce requires
the recent libblkid fields FSLASTBLOCK and FSBLOCKSIZE.
FSLASTBLOCK*FSBLOCKSIZE is the last byte used by the fs on the LV,
which determines if reducing the fs is necessary.

2 years agolvresize: restructure code
David Teigland [Fri, 9 Sep 2022 21:07:07 +0000 (16:07 -0500)]
lvresize: restructure code

Rewrite top level resize function to prepare for adding
new fs resizing.

2 years agoremove libblkid flag BLKID_SUBLKS_FSINFO
David Teigland [Fri, 9 Sep 2022 21:14:27 +0000 (16:14 -0500)]
remove libblkid flag BLKID_SUBLKS_FSINFO

This flag is not needed in fs_block_size_and_type()
added in the previous commit.

2 years agofix fs block size detection
David Teigland [Fri, 9 Sep 2022 20:16:56 +0000 (15:16 -0500)]
fix fs block size detection

blkid_get_tag_value() is not a reliable way to query the fs
BLOCK_SIZE, so use the "probe" functions instead.

2 years agogitignore: update
Zdenek Kabelac [Mon, 5 Sep 2022 10:08:50 +0000 (12:08 +0200)]
gitignore: update

2 years agotests: cache use 300M XFS
Zdenek Kabelac [Tue, 6 Sep 2022 23:02:29 +0000 (01:02 +0200)]
tests: cache use 300M XFS

2 years agotests: fsadm 300m xfs
Zdenek Kabelac [Wed, 31 Aug 2022 10:22:59 +0000 (12:22 +0200)]
tests: fsadm 300m xfs

2 years agotests: writecache adapt to 300M XFS
Zdenek Kabelac [Tue, 6 Sep 2022 17:00:55 +0000 (19:00 +0200)]
tests: writecache adapt to 300M XFS

2 years agotests: use conv=fdatasync
Zdenek Kabelac [Tue, 6 Sep 2022 16:47:03 +0000 (18:47 +0200)]
tests: use conv=fdatasync

When we only need wait for result - avoid using slow 'oflag=sync'
with virtual layers

2 years agotests: add /dev requirement
Zdenek Kabelac [Tue, 6 Sep 2022 16:00:28 +0000 (18:00 +0200)]
tests: add /dev requirement

This test could only be run when user passes  LVM_TEST_DEVDIR=/dev
as it requires and expects actions to be going in this dir, skip
otherwise.

Also 'extend_filter' manages multiple args in on lvm.conf update.

2 years agotests: add thin requirement
Zdenek Kabelac [Tue, 6 Sep 2022 15:59:25 +0000 (17:59 +0200)]
tests: add thin requirement

2 years agotests: lvextend update for 300M XFS
Zdenek Kabelac [Wed, 31 Aug 2022 12:30:01 +0000 (14:30 +0200)]
tests: lvextend update for 300M XFS

2 years agotests: no caching for blkid in testing
Zdenek Kabelac [Wed, 31 Aug 2022 12:14:59 +0000 (14:14 +0200)]
tests: no caching for blkid in testing

2 years agotests: make damage optional
Zdenek Kabelac [Wed, 31 Aug 2022 12:07:46 +0000 (14:07 +0200)]
tests: make damage optional

Investigate how to damage thin-pool across different versions/platforms.
Until them - use  'should' for test result.

2 years agotests: check for at least 1G of RAM
Zdenek Kabelac [Wed, 31 Aug 2022 11:57:41 +0000 (13:57 +0200)]
tests: check for at least 1G of RAM

This test requires quite some RAM to be there.

2 years agotests: remove slash
Zdenek Kabelac [Wed, 31 Aug 2022 11:26:30 +0000 (13:26 +0200)]
tests: remove slash

2 years agotests: skip this test for 5.19
Zdenek Kabelac [Wed, 7 Sep 2022 12:54:39 +0000 (14:54 +0200)]
tests: skip this test for 5.19

mdraid has some breakage - so 5.19 is crashing
(possibly even some more older version - that can be added as well)
Test seems to pass with 6.0-rc kernel.

2 years agotests: vdo emulation without vdo binary
Zdenek Kabelac [Tue, 6 Sep 2022 14:44:24 +0000 (16:44 +0200)]
tests: vdo emulation without vdo binary

Avoid inserting 'vdo' binary into path - and use
alias and VDO_BINARY shell vars for emulation.

2 years agotests: rework makefile
Zdenek Kabelac [Thu, 1 Sep 2022 08:06:14 +0000 (10:06 +0200)]
tests: rework makefile

Improve dependency tracking
Use 'foreach()' with better tracing support
Link whole 'shell' dir instead of linking individual *.sh files

2 years agomake: update make.tmpl
Zdenek Kabelac [Mon, 5 Sep 2022 13:56:58 +0000 (15:56 +0200)]
make: update make.tmpl

Add new define 'newline' for use in 'foreach()'
Add new $(SHOW) for makefile printing output
Add 'make print-VAR' for easier debugging of Makefiles' variables.

2 years agopython: variable without destdir
Zdenek Kabelac [Tue, 6 Sep 2022 14:09:39 +0000 (16:09 +0200)]
python: variable without destdir

PYTHON_PREFIX without $(DESTDIR)

2 years agogcc: eliminate warnings
Zdenek Kabelac [Mon, 5 Sep 2022 14:22:32 +0000 (16:22 +0200)]
gcc: eliminate warnings

Gcc starts to show new warning - although unlikely to be able to hit
initialize variables to 0.

2 years agoreport: fix lv_active column type from STR to BIN
Peter Rajnoha [Tue, 6 Sep 2022 12:40:06 +0000 (14:40 +0200)]
report: fix lv_active column type from STR to BIN

Fix lv_active to be of BIN type instead of STR. This allows lv_active to
follow the report/binary_values_as_numeric setting as well as --binary
cmd line switch. Also, it makes it possible to use -S|--select with
either textual or numeric representation of the value, like 'lvs -S
active=active' but also 'lvs -S active=1'.

2 years agovgimportdevices: fix locking when creating devices file
David Teigland [Tue, 30 Aug 2022 19:40:48 +0000 (14:40 -0500)]
vgimportdevices: fix locking when creating devices file

Take the devices file lock before creating a new devices file.
(Was missed by the change to preemptively create the devices
file prior to setup_devices(), which was done to improve the
error path.)

2 years agovgimportdevices: change result when devices are not added
David Teigland [Mon, 29 Aug 2022 20:17:36 +0000 (15:17 -0500)]
vgimportdevices: change result when devices are not added

When using --all, if one VG is skipped, continue adding
other VGs, and do not return an error from the command
if some VGs are added. (A VG is skipped if it's missing PVs.)

If the command fails during devices file setup or device
scanning, then remove the devices file if it has been
newly created by the command, and exit with an error.

If devices from a named VG are not imported (e.g. the
VG is missing devices), then remove the devices file if
it has been newly created by the command, and exit with
an error.

If --all VGs are being imported, and no devices are found
to include in the devices file, then remove the devices
file if it has been newly created by the command, and
exit with an error.

2 years agomm: use mallinfo2 when available
Zdenek Kabelac [Tue, 30 Aug 2022 11:48:18 +0000 (13:48 +0200)]
mm: use mallinfo2 when available

Switch to mallinfo2() from a deprecated mallinfo() glibc call
since struct size members where to small for 64b CPUs.

2 years agomm: preallocate memory only with glibc
Zdenek Kabelac [Fri, 19 Aug 2022 14:15:17 +0000 (16:15 +0200)]
mm: preallocate memory only with glibc

Use mallinfo() only with glibc.

2 years agoconfigure: remove some obsolete or duplicate checks
Zdenek Kabelac [Tue, 30 Aug 2022 11:36:52 +0000 (13:36 +0200)]
configure: remove some obsolete or duplicate checks

As autoupdate suggested, drop unneeded checks.

2 years agoconfigure: check for mallinfo2
Zdenek Kabelac [Tue, 30 Aug 2022 11:28:24 +0000 (13:28 +0200)]
configure: check for mallinfo2

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.

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