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

16047 Commits

Author SHA1 Message Date
Zdenek Kabelac
3750b0cff5 stats: fix error path when region is NULL
We should not call _stats_cleanup_region_ids() when regions
are NULL.
Also add backtracing for  goto.
2018-12-21 21:42:30 +01:00
Zdenek Kabelac
0161ebe484 scripts: simplify including for generator
Uses included .c file as primary header includer.
2018-12-21 21:42:30 +01:00
Zdenek Kabelac
a4577c427a scripts: avoid voiding write result
Gcc doesn't want to ignore write() return code.
2018-12-21 21:42:30 +01:00
Zdenek Kabelac
a3fe619552 lvmlockd: drop superfluous defines
These defines are automatically granted with _GNU_SOURCE
which is use for whole compilation via configure.h.
2018-12-21 21:42:30 +01:00
Zdenek Kabelac
71af650760 lvmlockd: use commonly used define NOTIFYDBUS_SUPPORT
Build with configured NOTIFYDBUS_SUPPORT, SYSTEMD_LIBS, SYSTEMD_CFLAGS.
Also add proper build dependencies on internal libraries.
2018-12-21 21:42:30 +01:00
Zdenek Kabelac
7832d35668 lvmlockd: fix error return code for _init_vg_sanlock
In few cases error paths from initialization were returned as
'success == 1'.

Also assing num_mb with single compare checking valid sector_size.

For dumb compiler make num_mb always defined.
2018-12-21 21:42:30 +01:00
Zdenek Kabelac
98924e4703 lvmpolld: improve makefile deps
Add correct build dependencies on internal libraries.
2018-12-21 21:42:23 +01:00
Zdenek Kabelac
18aa541ca2 configure: avoid repeative inclusion of configure.h
Since configure.h is a generated header and it's missing traditional
ifdefs preambule - it can be included & parsed multiple times.
Normally compiler is fine when defines have same value and there is
no warning - yet we don't need to parse this several times
and by adding -include  directive we can ensure every file
in the package is rightly compile with configure.h as the
first header file.
2018-12-21 19:19:50 +01:00
Tony Asleson
a7034fa420 tests/dbus: Re-enable nesting and pvcreate via symlink
If we are running the test where the device is /dev/* we will will
run the unit tests 'test_nesting' and 'test_pv_symlinks'.  Otherwise
we will skip them.
2018-12-20 10:27:30 -06:00
Tony Asleson
5bdcafff47 lvmdbusd: Handle exported VG(s)
When a VG is exported, the 'fullreport' returns an exit code of 5, but
otherwise returns the data we are wanting.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2018-12-20 10:27:30 -06:00
Tony Asleson
ab1f1a306b lvmdbusd: Exit daemon when unable to retrieve state
In some cases we get stuck where we are unable to retrieve the current
state of lvm as we are encountering an error.  When the error is
persistent we will log and exit the daemon instead of consuming vast
amounts of resources.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2018-12-20 10:27:30 -06:00
Zdenek Kabelac
3320ab8334 lib: move towards v2 version of VDO format
Drop very old original format of VDO target and focus on V2 version.
So some variables were renamed or replaced.
There is no compatibility preserved (with assumption so far this is
experimental feature and there is no real user).

Note - version currently VDO calls this version 6.2.
2018-12-20 13:26:55 +01:00
Zdenek Kabelac
9785e40b8d dmeventd: resolve compilation of vdo status parsing
A bit of chicken & egg problem - dmeventd needs to use old libdm library.
VDO is only part of new device_mapper internal library.

So include directly source file for parsing status - this fixes usability
problem of VDO plugin introduced with previous Makefile reshaping
patchset.

NOTE: source file needs to be keep then compilable in both environments.

Also add missing copyright header.
2018-12-20 13:26:55 +01:00
Marian Csontos
f05104af76 cov: Close a FD on error 2018-12-19 16:29:31 +01:00
Marian Csontos
b068f21f6a lvmlockd: Fix arguments when built without sanlock
(cherry picked from commit 24254ca866)
2018-12-18 17:42:22 +01:00
Marian Csontos
93c7bca08f Revert "tests: Remove unsupported mirrored mirrorlog"
Incorrect cherry pick from another branch.

This reverts commit 07fc4866f0.
2018-12-18 10:55:35 +01:00
Marian Csontos
88153c7c0a build: Remove badly placed @ 2018-12-18 09:54:47 +01:00
Marian Csontos
e0c2d374ae build: Remove reference to undefined @BUILD_LVMETAD@ 2018-12-18 09:54:45 +01:00
Marian Csontos
07fc4866f0 tests: Remove unsupported mirrored mirrorlog 2018-12-18 09:54:42 +01:00
Heinz Mauelshagen
e82303fd6a lvcreate/lvconvert: optionally reenable mirrored mirror log for testing purposes only
This is a followup patch to commit edb72cb70c
to support related lvm2 test suite tests.

A 'global/support_mirrored_mirror_log' bool configuration variable gets
introduced allowing the creation of, or conversion to mirrored 'mirror'
logs if set.  The capability to create these in turn allows the rest of
the tests to perform activation of such existing LVs and their conversions
to disk/core 'mirror' logs.

Display a disclaimer warning if enabled that this is not for regular use.

Add definition of the enabled config option to respective test scripts.

Related: rhbz1643562
2018-12-17 19:28:54 +01:00
David Teigland
1f1d36f6a2 unit test: use_lvmetad replaced by event_activation 2018-12-17 10:04:44 -06:00
Zdenek Kabelac
2076dda0b8 makefiles: also fix build of unit test 2018-12-17 11:51:38 +01:00
Zdenek Kabelac
5db56b36f1 makefile: fixes build for older system
With older gcc - we need to resolve symbols linked with devmapper-event
that is now using -ldevmapper.

Also add forgotten systemd library needed for dbus notification.
2018-12-17 11:41:38 +01:00
Zdenek Kabelac
94237354dd makefiles: correcting login of makefile
Fixing some ordering issue with inclusion of common make.tmpl.
Correcting dependency calculation
Simplifying inclusive makefile
2018-12-17 10:55:20 +01:00
Zdenek Kabelac
0dc7abe013 makefiles: dm-tools improve Makefile 2018-12-17 10:55:20 +01:00
Zdenek Kabelac
b5366b1d8d makefiles: allow to set LIBS in Makefiles
Avoid doing hard set of LIBS var,
so if the LIBS is set before 'include make.tmpl' it's not lost.
This gives better control over order of linked libraries.
2018-12-17 10:55:19 +01:00
Zdenek Kabelac
143c8dcd7f makefiles: no longer used define
Not used anymore -D_BUILDING_LVM
2018-12-17 10:51:01 +01:00
Zdenek Kabelac
a665206453 makefiles: missing cleaning 2018-12-17 10:36:52 +01:00
Zdenek Kabelac
f619cac598 makefiles: quite install 2018-12-17 10:36:52 +01:00
Zdenek Kabelac
a63015442e makefiles: drop unneeded LIBS add 2018-12-17 10:36:52 +01:00
Zdenek Kabelac
d76b4afb8e makefiles: sort 2018-12-17 10:36:52 +01:00
Zdenek Kabelac
a8cdd9e16a cmirror: link with libdm
Since there is very little change there will be any new devel going
to happing with cmirror - avoid eating extra disk space and link
with already installed libdm which implements all use basic
function of dm list
2018-12-17 10:36:52 +01:00
Zdenek Kabelac
701ecff0ff lvm: drop usage of dl library
Since lvm no longer supports any dlopen-able plugins
(which in practice was never really usable) drop linking
with -ldl.
2018-12-17 10:36:52 +01:00
Zdenek Kabelac
8bf445b2de dmeventd: do not link internal libraries to plugins
Avoid linking internal device-mapper and link dynamically libdevmapper.
This considerably reduced size of installed binaries.
2018-12-17 10:36:52 +01:00
Zdenek Kabelac
035a7b9a4b dmeventd: fix linking with libdevmapper
Since dmeventd is 'libdm' based project, it needs to link
libdm library instead of its internal version

An external users may provide plugins loadeable by dmeventd.
So external user of libdevmapper-event library has no other option
then to link with released libdevmapper library.

The complexity comes with lvm2 plugins.
The lvm2 plugin itself uses internal version of device_mapper,
but libdevmapper-event usage is libdm based - so there needs to be avoided
any breakage on compatibility of internal i.e. dm_task_run structures.

TODO: most likely dmeventd itself should be moved into libdm/dm-tools dir,
and only lvm2 plugins should be created as part of lvm project,
but those still need to link with libdevmapper.
2018-12-14 22:33:22 +01:00
Zdenek Kabelac
c666e8d25e dmfilemapd: avoid linking with DL_LIBS
Dmfilemapd is not using dlopen so doesn't need to be linked with
DL_LIBS.
2018-12-14 22:27:33 +01:00
Zdenek Kabelac
f514e37978 lvconvert: ensure proper init of pv_list 2018-12-14 22:27:33 +01:00
Tony Asleson
2e01af0f78 lvmdbusd: Update table lookup for state lv_attr 2018-12-14 08:28:03 -06:00
Tony Asleson
a6cba2d0a0 lvmdbusd: Update table lookup for health lv_attr 2018-12-14 08:28:02 -06:00
Tony Asleson
51f08efaa7 lvmdbusd: Handle missing lv_attr table lookups
If we don't know the meaning we will return the key with default text
instead of raising an exception and taking the daemon out in the
process.

Resolves: rhbz1657950
2018-12-14 08:28:02 -06:00
Tony Asleson
f1684bf8e8 lvmdbusd: Dump blackbox newest first
When we get bug reports we may not get the entire log, so lets
dump the fight recorder from newest to oldest as the one we
are interested in was likely to be the last command run.
2018-12-14 08:28:02 -06:00
Ming-Hung Tsai
859feb81e5 lvmanip: uninitialized members in struct pv_list (#10)
Scenario: Given an existed LV `lvol0`, I want to create another LV
on the PVs used by `lvol0`.

I use `build_parallel_areas_from_lv()` to obtain the `pv_list` of each segments.
However, the returned `pv_list` is not properly initialized, which causes
segfault in subsequent operations.
2018-12-14 15:23:18 +01:00
Zdenek Kabelac
db6d9e04af debug: drop extra tracing
Stack tracing after log_error() is not needed.
2018-12-14 15:14:48 +01:00
Zdenek Kabelac
cc5cfb88d7 cleanup: some local headers first 2018-12-14 15:14:48 +01:00
Zdenek Kabelac
73bef5e3dd makefiles: some leftovers from lvmetad 2018-12-14 15:14:48 +01:00
Zdenek Kabelac
4801919b01 makefiles: local headers first 2018-12-14 15:14:48 +01:00
Zdenek Kabelac
454024f957 makefiles: drop unneeded include path 2018-12-14 15:14:48 +01:00
Zdenek Kabelac
0f5bdd4d31 makefiles: correct libdm dependency
Correcting dependency tracking for libdm internal files.
2018-12-14 15:14:32 +01:00
Zdenek Kabelac
63b0f0dab8 headers: use full path header instead of -I directive
Replace Makefile -I  with full path to headers like we use now
everywhere else.
2018-12-14 15:13:38 +01:00
Zdenek Kabelac
0b19387dae headers: use configure.h as 1st. header
Ensure configure.h is always 1st. included header.
Maybe we could eventually introduce gcc -include option, but for now
this better uses dependency tracking.

Also move _REENTRANT and _GNU_SOURCE into configure.h so it
doesn't need to be present in various source files.
This ensures consistent compilation of headers like stdio.h since
it may produce different declaration.
2018-12-14 15:09:13 +01:00