Petr Rockai [Wed, 5 Jan 2011 00:16:18 +0000 (00:16 +0000)]
Substantial rework of the functional test support code. Some new features:
- somewhat neater, more consistent and more readable output
- possible to set any lvm.conf value: aux lvmconf "section/key = value"
- LVM_TEST_NODEBUG to suppress the (lengthy) "## DEBUG" output
- back-substitution on test output ($TESTDIR/$PREFIX -> @TESTDIR@/@PREFIX@)
- support code moved from test/ to test/lib/ --> less clutter
Zdenek Kabelac [Wed, 22 Dec 2010 15:44:09 +0000 (15:44 +0000)]
Remove check for existance of vg pointer
Checking for vg being != NULL in this place is not needed.
Pointer vg is already dereferced in this function above this code line.
Also this internal function _read_pv is always called with valid 'vg' pointer.
Zdenek Kabelac [Wed, 22 Dec 2010 14:00:28 +0000 (14:00 +0000)]
Fix last pthread_join fix commit
Call for pthread_join() does not set errno value even though return values
looks like that. For now assign errno from return value and still use
strerror() to print some error message as this seems to be commonly used.
Add also log_sys_error() message for error close of local pipe.
Zdenek Kabelac [Mon, 20 Dec 2010 13:39:12 +0000 (13:39 +0000)]
Use const char* for offset calculation
As 'const' types are also passed to macro dm_list_struct_base -
keep offset calculation with const char pointers.
Fixes several gcc constness warnings.
Zdenek Kabelac [Mon, 20 Dec 2010 13:32:49 +0000 (13:32 +0000)]
Remove const usage from destroy callbacks
As const segment_type or const format_type are never released
use their non-const version and remove const downcast from dm_free calls.
This change fixes many gcc warnings we were getting from them.
Zdenek Kabelac [Mon, 20 Dec 2010 13:12:55 +0000 (13:12 +0000)]
Add more strict const pointers around config tree
To have better control were the config tree could be modified use more
const pointers and very carefully downcast them back to non-const
(for config tree merge).
Peter Rajnoha [Mon, 13 Dec 2010 10:49:02 +0000 (10:49 +0000)]
Create /var/run/lvm directory during clvmd initialisation if missing.
We need to be sure that /var/run and /var/lock is always there.
(E.g. these two directories could be using tmpfs which then loose
all the content after reboot.)
Peter Rajnoha [Mon, 13 Dec 2010 10:43:56 +0000 (10:43 +0000)]
Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout.
Detect existence of new SELinux selabel interface during configure.
Use new dm_prepare_selinux_context instead of dm_set_selinux_context.
We should set the SELinux context before the actual file system object creation.
The new dm_prepare_selinux_context function sets this using the selabel_lookup
fn in conjuction with the setfscreatecon fn. If selinux/label.h interface
(that should be a part of the selinux library) is not found during configure,
we fallback to the original matchpathcon function instead.
Alasdair Kergon [Fri, 10 Dec 2010 22:39:52 +0000 (22:39 +0000)]
Fix scanning of VGs without in-PV mdas.
Set cmd->independent_metadata_areas if metadata/dirs or disk_areas in use.
- Identify and record this state.
Don't skip full scan when independent mdas are present even if memlock is set.
- Clusters and OOM aren't supported, so no problem doing the proper scans.
Avoid revalidating the label cache immediately after scanning.
- A simple optimisation.
Support scanning for a single VG in independent mdas.
- Not used by the fix but I left it in anyway as later patches might use it.
Zdenek Kabelac [Wed, 1 Dec 2010 12:22:49 +0000 (12:22 +0000)]
Test lv_name is not NULL
Patch adds extra check for lv_name not being NULL.
Test avoids unneeded strlen call for this case.
Otherwise there is no functional change as test would fail on
size_t comparation even for NULL lv_name (thus there is no risk
of NULL dereference when taking 'true' if branch.
Zdenek Kabelac [Tue, 30 Nov 2010 22:53:37 +0000 (22:53 +0000)]
Test uuid for NULL
Add test for NULL before passing uuid as src argument to memcpy.
As memcpy function is declared as function not accepting NULL.
Though we pass NULL only with zero length so this patch presents
no functional change to the code.
Zdenek Kabelac [Tue, 30 Nov 2010 22:23:35 +0000 (22:23 +0000)]
Add missing test for failed pool allocation
Add test for NULL from dm_poll_create.
Reorder dm_pool_destroy() before file close and add label out:.
Avoid leaking file descriptor if the allocation fails.
Alasdair Kergon [Mon, 29 Nov 2010 18:35:37 +0000 (18:35 +0000)]
Fix memory leak when VG allocation policy in metadata is invalid.
Ignore unrecognised allocation policy found in metadata instead of aborting.
Fix another missing vg_release() in _vg_read_by_vgid.