1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

19206 Commits

Author SHA1 Message Date
Zdenek Kabelac
efe2005022 const: drop static keyword
We don't need relocatable space to store 'const' number.
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
abf7c40185 const: static array
Such array can be stored  in   .rodata   section.
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
acabc995c0 const: config items 2024-05-04 01:01:57 +02:00
Zdenek Kabelac
9f506eb89e const: raid takover arrays 2024-05-04 01:01:57 +02:00
Zdenek Kabelac
6430a6ca63 const: _fns poll_function 2024-05-04 01:01:57 +02:00
Zdenek Kabelac
ff699eab24 const: _ops text_vg_version 2024-05-04 01:01:57 +02:00
Zdenek Kabelac
41ffa8c74d const: _ops labeler _text_ops 2024-05-04 01:01:57 +02:00
Zdenek Kabelac
64cb8b5940 const: _ops segtype handler 2024-05-04 01:01:57 +02:00
Zdenek Kabelac
effafa8fc8 const: _ops text handler
Making sure these structures ends in '.data.rel.ro' section.
(instead of plain '.data' section).
2024-05-04 01:01:42 +02:00
Zdenek Kabelac
2a1e200f7a libdm: fix condition
When we switch supported_reserved_types_with_range to const
gcc repots this problem:

 warning: ‘and’ of mutually exclusive equal-tests is always 0
 !(iter->type & supported_reserved_types_with_range))) {

It's not clear from the history what was the actual intention of this
internal error test, let's assume the check wanted to make sure
that when DM_REPORT_FIELD_RESERVED_VALUE_RANGE is set,
some other fields from supported_reserved_types_with_range set
are also selected.
2024-05-04 00:58:44 +02:00
Zdenek Kabelac
9b2f9d64c0 libdm: ensure suffixes list elements are const
This was rather API mistake - the internal of libdm
do handle suffixes list as const string, just the API
was only using  'const char **'.

So the user may pass safely casted 'const char * const`.
2024-05-04 00:57:52 +02:00
Zdenek Kabelac
e02695cb45 lvonvert: support control over wipingsignature
When converting volume to a thin-pool allow control over
signature wiping.

TODO: likely should become more commonly supported option...
2024-05-04 00:57:52 +02:00
Zdenek Kabelac
a6f4aed3c0 vdo: enhance error path
When the conversion to VDO fails, try to restore previous VG state
and also remove orphan DM node from table.
2024-05-04 00:57:14 +02:00
Zdenek Kabelac
1f92fc2af7 lvcreate: --yes option for thin-pool vdo creation
Correct typo and accept proper --yes option instead
of misplaced --force option.
2024-05-04 00:56:32 +02:00
Zdenek Kabelac
a98f908c23 command: correct lvresize
Code for supporting size reduction of pool metadata is not yet present
so don't pretend the option can work as pushed in previous commit.
2024-05-02 13:18:08 +02:00
Zdenek Kabelac
54e2de82c0 WHATS_NEW: update 2024-05-02 12:07:47 +02:00
Zdenek Kabelac
8f37c22df2 make: generate
Update lvresize options with +/-.
2024-05-02 12:04:07 +02:00
Zdenek Kabelac
1ab66f37ae command-lines: improve spec for thin snapshot
man-generate --check actually noticed 2 same definitions
for snapshot create  with 'lvreate -T [--snapshot]'
and 'lvcreate --snapshot [-T]'.
So drop the '-T' from second alternative variant as
thin type is already implied here.
2024-05-02 12:04:07 +02:00
Zdenek Kabelac
611975c51b use LVM_COMMAND_COUNT 2024-05-02 12:04:07 +02:00
Zdenek Kabelac
eeffc1d52b man-generator: code reformating 2024-05-02 12:04:07 +02:00
Zdenek Kabelac
b4670db008 command: refactor to use const command structure
Refactor code so the definitions may become 'static const'
and with configure_command_option_values() we update options
val_enum for actually running command option when used.

Also update _update_relative_opt() which is used for
generating man pages and command help.

Introduce enumeration for lvm2 commands - so we may
use enum cmd_COMMAND instead of string checking.

So running command now does not modified opt_names.
2024-05-02 12:01:06 +02:00
Zdenek Kabelac
0b064aedb3 command: embedding strings to structs
Since we will make these struct const, we can also
embedding string content into them to avoid unnecessary
pointer relocations.
2024-05-02 11:59:42 +02:00
Zdenek Kabelac
6f8abdc978 cleanup: tab indent and typo 2024-05-02 11:58:26 +02:00
Zdenek Kabelac
db6bb6e90b cleanup: unlink passes with ENOENT 2024-05-01 10:55:17 +02:00
Zdenek Kabelac
061fa7b690 cleanup: remove unused code 2024-05-01 10:55:17 +02:00
Zdenek Kabelac
2a39ed7741 writecache: reuse some API
Tiny code updates, reuse dm_pool_strdup().
2024-05-01 10:55:17 +02:00
Zdenek Kabelac
b8d5c4b41a memory: compile with VALGRIND_POOL
Function to _allocate_memory() was not compiled-in when lvm2 was
build with support for better tracking memory pool with valgrind.
Instead now correctly avoid this function only when running
withing valgrind environment.
2024-05-01 10:54:54 +02:00
Zdenek Kabelac
d5da7604e5 memory: convert log_error
As the memory locking is not causing command's error - convert
error messages to warnings and debugs.
2024-05-01 10:54:54 +02:00
Zdenek Kabelac
7ec0f69cd1 toolcontext: introduce var for run in valgrind 2024-05-01 10:54:34 +02:00
Zdenek Kabelac
9162ae0a0a activation: interruptible sleep when talking to dmeventd 2024-05-01 10:54:34 +02:00
Zdenek Kabelac
c35385a1cd cleanup: drop double _ 2024-04-29 00:13:43 +02:00
Zdenek Kabelac
26cbd4057a lvmcmdline: code update 2024-04-29 00:13:43 +02:00
Zdenek Kabelac
e654b9cba9 command: more arrays keep static 2024-04-29 00:13:43 +02:00
Zdenek Kabelac
45d9b2c470 command: more static const declaration
Use static const for declared arrays.
Access to arrays through get_ functions().
2024-04-29 00:13:43 +02:00
Zdenek Kabelac
d2f953c9db command: use const declaration for arrays 2024-04-29 00:13:43 +02:00
Zdenek Kabelac
063910c54b command: refactor common code to command_enum.h
Move shared code to command_enum.h and avoid duplicating code.
2024-04-29 00:13:43 +02:00
Zdenek Kabelac
f453665f92 lvchange: constify option array 2024-04-29 00:13:43 +02:00
Zdenek Kabelac
cd69d58fcd command: using single printf call
Use single string for 1 printf() call with \t tabs.
2024-04-29 00:13:43 +02:00
Zdenek Kabelac
0316dd7955 command: refactor loop test for end of string 2024-04-29 00:13:43 +02:00
Zdenek Kabelac
e1211d38a4 command: refactor test for relative opt
Use _update_relative_opt to check for relative option and
update val_enum accordingly.
2024-04-29 00:13:43 +02:00
Zdenek Kabelac
ee45cd8965 man-generator: some switch case refactoring 2024-04-29 00:13:43 +02:00
Zdenek Kabelac
6ece8b74f0 command: split man-generator code
Move code for generating man pages to man-generator.c
which is no longer a symlink to command.c and just
includes this file for the common code.
2024-04-29 00:13:43 +02:00
Zdenek Kabelac
063ade474c command: refactor if condition 2024-04-29 00:13:43 +02:00
Zdenek Kabelac
ecabdf68cf lvconvert: use cmd_context variable
Do not modify flags field from 'strcut command_name' and
instead control this via cmd_context  get_vgname_from_options.

Flag GET_VGNAME_FROM_OPTIONS is currently used only by lvconvert.
2024-04-29 00:13:43 +02:00
Zdenek Kabelac
1bb03cff66 lvmdbusd: its fine if dir already exists
With previous patch, we now need to handle the case
when dir already exists.
2024-04-29 00:13:43 +02:00
Zdenek Kabelac
7c4be946cb dmeventd: use standard reopening mechanism
Apply same code for reopening /dev/null for 0,1,2 when daemonizing.
2024-04-27 00:36:24 +02:00
Zdenek Kabelac
d194fb8513 daemon-stray: correct size limitation for filename
Correct the buffer size for filename printing.
2024-04-26 23:51:38 +02:00
Kai Kang
b3189d9b15 lvmdbusd: create dirs for lock file
Create leading dirs for lvmdbusd lock file, otherwise it fails to start:

| systemd[1]: Starting LVM2 D-Bus service...
| lvmdbusd[1602]: [1602]: Error during creation of lock file(/var/lock/lvm/lvmdbusd): errno(2), exiting!

Signed-off-by: Kai Kang <kai.kang@windriver.com>
2024-04-26 23:17:56 +02:00
Zdenek Kabelac
6e985f553b WHATS_NEW: update 2024-04-26 21:37:52 +02:00
Zdenek Kabelac
e51c2376dd make: generate 2024-04-26 21:37:52 +02:00