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

19156 Commits

Author SHA1 Message Date
Zdenek Kabelac
81dc0e72da tests: explicitely use event_activation=1
Some test do expect event_activation to be set.
So add explicit configuring of this setting in tests,
but also add new default which kind of does it globally
as it's expected default  (yet our testing rpms might
be create with disabled event_activation)
By adding this to each test individually - it's now easy
to locate such tests...
2024-04-12 00:21:45 +02:00
Zdenek Kabelac
d6b15e755e dmeventd: reduce some static variable usage
Move static to main() local vars.

Initilize libdm logging also before starting _restart_dmeventd()
so function there can be also logged.

Move call of _info_dmevent() out of option processing - so some
options like -V are processed with higher priority.
2024-04-12 00:20:43 +02:00
Zdenek Kabelac
5e3224c57d dmeventd: no log when after unlink file is gone
Check for errno ENOENT.

TODO: there should be global wrapper for this...
2024-04-12 00:14:03 +02:00
Zdenek Kabelac
54840d867e devmapper-event: add unlock into init_fifo error path
Unlock server path if there is open failure for client_path
and whole init_fifos() function is returning failure.
2024-04-12 00:14:02 +02:00
Zdenek Kabelac
3a433b14f2 dmeventd: rework _restart_dmeventd
Use _restart_dmeventd() with return values 0,1,2.
Also let's use already created fifos struct.

Make sure the _systemd_activation variable is properly initialized
from _systemd_handover before calling _restart_dmeventd() as
this variable is used there to decide where   1 or 2 should
be returned - aka either letting systemd to initilize
or restart dmeventd itself.
2024-04-12 00:14:01 +02:00
David Teigland
449af6c335 lvmlockd: use sanlock.h for defines 2024-04-11 10:50:06 -05:00
Zdenek Kabelac
fd0517c82b spec: try with default dependency tracking
Check whether we have now all dependencies right.
2024-04-10 17:38:26 +02:00
Zdenek Kabelac
543011fa86 spec: when building rpm on test machine disable event_activation
This is initial test how to disable event_activation on
machines, where lvm2-testsuite packages are installed
with its lvm.conf file.

TODO: find more elegant mechanism
2024-04-10 17:38:26 +02:00
Zdenek Kabelac
ac3cee638b spec: update default values
Reverse condition and downgrade setting for older versions.
Also define proper version strings
2024-04-10 17:38:26 +02:00
Zdenek Kabelac
8ba9574ed4 tests: aux extend lvmdbusd timeout for startup
Unclear yet what's going on here - so try waiting up 10second
to see if our service will get there.
Print task list if not...
2024-04-10 17:38:26 +02:00
Zdenek Kabelac
faf4fe0714 tests: use lvname with space
Occasionally this test fails as soemtimes UUID actually
may constain LV[d] string causing it to grep mismatch
UUID and LV name and eventually fail test for wrong reason.

As a simple workaround print the LV name first and
check the name is followed by a space character.
2024-04-10 17:36:50 +02:00
Zdenek Kabelac
a14cb2495b WHATS_NEW: update 2024-04-10 00:04:54 +02:00
Zdenek Kabelac
8d1a946a9b tests: update unit-tests
Fix some memleaks.
Drop call of bcache_clear_fd() when bache was not initialized.
2024-04-10 00:04:54 +02:00
Zdenek Kabelac
8a2839c867 tests: update for faster dmeventd
We can drop sleep 6, since dmeventd will quit immediatelly
when no running dmeventd can be restarted.

Also restart itself check more conditions.
2024-04-10 00:03:33 +02:00
Zdenek Kabelac
6382d141fa tests: add missing vgck
This test missed being adjusted with this updated workflow
so it's been testing something different...
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
32c6dbb425 tests: aux fallback to sleep
When dbus-send tool is not present on system, fallback to sleep.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
6a95c66f5b tests: drop test warning
These kernel are not going to be ever fixed, so drop warning
being displayed for these tests.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
fa62397ff8 cov: mask false positive
This code is somewhat complex and involves recursion and pointer
shuffling which confuses coverity here.

Let's add masking comment for this warning as there is no double
free in this code.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
2b9c3f8dc9 cov: pass buffer size 2024-04-10 00:03:09 +02:00
Zdenek Kabelac
82f50dc800 gcc: remove warning about inlining failure
Persuade gcc we want this function to be inline and avoid:
  warning: inlining failed in call to ‘lvmlockd_open.constprop.0’:
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
2b802ab413 cov: use check of snprintf result
Do validation in one go with snprintf() result,
so there is no extra strlen() and uncheck possibly truncating snprintf()
visible to coverity.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
c5b4574729 cov: use stream ptr in its original form
Let's stop Coverity thinking here we are using freed FILE*
for anything else then comparing numbers.
For this use the original source of old_stream pointer.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
2a8c195360 cov: use dm_strncpy variant 2024-04-10 00:03:09 +02:00
Zdenek Kabelac
cb16f5053f cov: make obvious how free of memory happens
When there is allocation, it needs also deallocator.
Remove no longer needed coverity warning masking.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
e7a54c1a50 cov: use safer version with size limitation
Although there is likely not much risk of having chance of overwritting
given buffers use safer variant.
Use dm_strncpy() when just copying %s.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
3ce83f923d cov: extra pointer validation
Add few more internal errors to enusure there is no use of NULL pointers
along the code path.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
8545621d39 cov: replace strcpy with memcpy
When we know the size we can avoid using strcpy.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
22a0cfdc05 cov: use memccpy
When we want to copy string which may not be null terminated,
replace strncpy with more correct memccpy.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
f27273e1f0 dmeventd: restart checks for running daemon
Check whether the pid file is associated with running daemon.
If not there is not much point to wait many seconds in loop.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
f27388b5d8 toolib: skip when there is no vg and error_vg
We must skip even if the skip would be suggesting otherwise
if there is no vg and no error_vg as there is nothing to process.
2024-04-09 17:47:55 +02:00
Zdenek Kabelac
cd9b2b32aa configure: add --with-default-event-activaion=ON
Add new configurable option for building lvm2 with enable/disable
default autoactivation setting.

Might be useful for building i.e. rpms for systems where
this event_activation is not desired.
2024-04-09 17:47:03 +02:00
Zdenek Kabelac
9dad6f202c reporter: correcting failure return value
This function do use ECMD_ return values,
so use ECMD_FAILED as initial value - used for internal error paths
2024-04-09 17:43:23 +02:00
Zdenek Kabelac
f404d8ccb7 gitignore: add more ignored suffixes 2024-04-08 22:24:18 +02:00
Zdenek Kabelac
5125629f2a makefiles: add libdm as deps for unit-test
When using just 'make check' ensure we make also dmsetup
so it's not needed to run explicit 'make' to get all the tools.
2024-04-08 22:24:18 +02:00
Zdenek Kabelac
39d375ecd1 tests: include date and hostname IPs in test log
When our testing machines are going wild with NetworkManager,
this might be slightly helping.
2024-04-08 22:24:18 +02:00
Zdenek Kabelac
b120b2932d tests: add timestamp to kernel line
Parse timestamps included in kernel kmsg line and add current system
time to the messsage as well - this makes it easier to look over,
when chasing some messages in journal after some time...
2024-04-08 22:24:18 +02:00
Zdenek Kabelac
08888d57cb tests: check for supported dBus interface
Instead of blindly relying on sleeping, that dBus understands our
dBus interface, query the info with dbus-send.
2024-04-08 22:24:18 +02:00
Zdenek Kabelac
f524dd80f4 tests: query dmeventd instead of sleep
Checking status of running instance of dmeventd should be a better 'sleep'.
2024-04-08 22:24:18 +02:00
Zdenek Kabelac
092951f634 dmeventd: check for running dmeventd for status
Before initiation fifo communication, check whether there is
running dmeventd - in case there is no running instance, this
would be just blocked for 5 seconds trying to open fifo.
2024-04-08 22:24:18 +02:00
Zdenek Kabelac
d8e52aed87 tests: use non inlined copy constructor
gcc would like to see code without trying to inline large
copy constructor used for std::vector
2024-04-08 14:52:28 +02:00
Zdenek Kabelac
6ec84993bd makefiles: avoid using # with awk
Also awk got annoyed by this \# char sequence which is reported
as incorrect, however older rpm builder were failing without this.
So let's just try other variant.
2024-04-08 14:52:23 +02:00
Zdenek Kabelac
88ad83e3d6 makefiles: use SHOW 2024-04-08 14:52:23 +02:00
Zdenek Kabelac
d490572410 gcc: clear some complains
Use dm_strncpy() were possible to get rid of gcc compile warnings.
2024-04-08 14:52:23 +02:00
Zdenek Kabelac
aae27f6be6 WHATS_NEW: update 2024-04-07 20:47:28 +02:00
Zdenek Kabelac
04e8f8c93d tests: add sleep
mdadm may eventually be too slow...
2024-04-07 20:47:28 +02:00
Zdenek Kabelac
d6df31fba1 pools: no checking for lv/vgremove deactivation
Thin-pool and cache-pool targets got already quite stable so let's try
to remove checking of pools when using lvremove or vgremove commands.

This skips checking pools when they are going to be removed, but it
also when removing thin volume that was the only user of a thin-pool.
In this case thin-pool will be still there and could be activated
again with another thin volume and thin_check will be executed
in this moment. In this case it can delay discovery of metadata damage.
2024-04-07 20:44:28 +02:00
Zdenek Kabelac
2fdf3b137a thin-pool: avoid reactivation on new thin-pool
Shortens processing of 'lvcreate -L -V -T' command and
avoid deactivation and its activation with thin_check of the empty
created thin-pool that will be used for the new thin volume
made with a single lvcreate command.
2024-04-07 20:38:55 +02:00
Zdenek Kabelac
dbc0105e1a vdo: modprobe dm-vdo for kernels >= 6.9
Modprobe "dm-vdo" with new kernels >= 6.9 and go for
'kvdo' with older Linux kernels.
2024-04-07 20:27:39 +02:00
Zdenek Kabelac
a82b93b298 WHATS_NEW: update 2024-04-05 14:31:54 +02:00
Zdenek Kabelac
7fbd3bac71 tests: skip convertions tests for usptream driver 2024-04-05 14:25:27 +02:00