1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

8233 Commits

Author SHA1 Message Date
Zdenek Kabelac
6fa95d17ee dmeventd: move format text to printf
Instead of passing argument with format string to printf(),
put the string as arg directly.
Also move there remains args to make the code shorter.
2013-11-22 21:00:51 +01:00
Zdenek Kabelac
069fa6c49d activate: modify read_only when dev_manager exists
Change opts only when dm has been successfully created.
So on the error path we leave structure unmodified.
2013-11-22 20:58:13 +01:00
Zdenek Kabelac
4a061a35c7 snapshot: use lv_check_not_in_use
Instead of plain open_count check, try to use 'smarter'
lv_check_not_in_use() function.
2013-11-22 20:58:11 +01:00
Zdenek Kabelac
6d196410fc snapshot: revert and move check to lvconvert
Revert 4777eb6872 which put
target_present check into init_snapshot_merge(). However
this function is also used when parsing metadata. So we would
get this present test performed even when target is not really
needed. So move this target_present test directly into lvconvert.
2013-11-22 20:57:30 +01:00
Zdenek Kabelac
3d3b8bfd1c pv_write: check for lvmcache_add_mda failure
Add missing test of failing lvmcache_add_mda() call.
2013-11-22 20:55:09 +01:00
Zdenek Kabelac
a50a297f6e report: detect dev_get_size failure
Since dev_get_size() may fail, detect this failure.
2013-11-22 20:54:16 +01:00
Zdenek Kabelac
08d6d81cc2 filters: drop extra slash from sysfs path
Sysfs filter was using '/sys//class/block' with double '//' inside.
Remove this extra '/'.
Also simplify code around and use loop to try those paths.
2013-11-22 20:53:31 +01:00
Alasdair G Kergon
4c1f281b43 toollib: Avoid undefined ignore_vg parameter.
Fix process_each_segment_in_pv to always set ret before calling ignore_vg().
2013-11-22 18:11:04 +00:00
Tony Asleson
7c8abb29df liblvm/python API: Additions & fixes
Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:54:18 -06:00
Tony Asleson
5588a56391 python_lvm_unit.py: Add test for new name validate methods
Test naming validate names for VG and LV names.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:47 -06:00
Tony Asleson
370520a310 python_lvm_unit.py: Clean-up method names & scope
Changed naming of methods from camel case to all lower case with
underscores per guidelines.  Changed any methods that can be
static methods to static.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:45 -06:00
Tony Asleson
12d5e53953 lvm2app: Remove forward declarations.
Remove the forward struct declaration.  This isn't needed for
implementing opaque data pointers.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:44 -06:00
Tony Asleson
fe5b538c14 lvm2app: Reset buffer after retrieving error message
The error buffer will stack error messages which is fine.  However,
once you retrieve the error messages it doesn't make sense to keep
appending for each additional error message when running in the
context of a library call.

This patch clears and resets the buffer after the user retrieves
the error message.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:42 -06:00
Tony Asleson
0c7a7d4d84 python-lvm: VG/LV name validation.
Python portion of
https://bugzilla.redhat.com/show_bug.cgi?id=883689

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:40 -06:00
Tony Asleson
0dd247502a lvm2app: Add VG/LV name validation
C library portion for
https://bugzilla.redhat.com/show_bug.cgi?id=883689

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:39 -06:00
Tony Asleson
e54e70dc66 python-lvm: Update and enable unit test case
Added tests for lvm.pvCreate and enable the test suite.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:37 -06:00
Tony Asleson
531d85a0ee python-lvm: Add addl. PV create arguments
Added overloaded PV create arguments with defaults for PV
creation.

Addresses bug: https://bugzilla.redhat.com/show_bug.cgi?id=880395

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:36 -06:00
Tony Asleson
04304ba735 lvm2app: Add ability to create PV with args
Add a PV create which takes a paramters object that
has get/set method to configure PV creation.

Current get/set operations include:
- size
- pvmetadatacopies
- pvmetadatasize
- data_alignment
- data_alignment_offset
- zero

Reference: https://bugzilla.redhat.com/show_bug.cgi?id=880395

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:34 -06:00
Tony Asleson
ec7f632ce0 python-lvm: Test case change for vg.reduce
Fix reduce as newly changed vg reduce fails when you
try to remove the last pv in the vg.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:32 -06:00
Tony Asleson
5074dcc896 metadata.c: Call refactored vgreduce_single
Replace the code with the refactored vgreduce_single instead
of calling its own implementation.

Corrects bug: https://bugzilla.redhat.com/show_bug.cgi?id=989174

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:30 -06:00
Tony Asleson
fe474e1452 vgreduce: Move _vgreduce_single functionality
Moving the core functionality of vgreduce single into
lib/metadata/vg.c so that the command line and lvm2app library
can call the same core functionality.  New function is
vgreduce_single.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:28 -06:00
Tony Asleson
20ffb0f721 python-lvm: Ensure library handle is correct after python gc() call
In a previous commit we added the ability for the library to do garbage
collection, to free all the memory used by the library handle buffer by closing
and re-opening the library handle.  When we introduced this functionality we
also opened up the opportunity that the user of the python bindings to have
an object that references the old library handle.  In this case if the user
tried to use the old object a segmentation fault could occur because the
memory had been previously freed.

This patch tries to mitigate this by storing a copy of the library handle that
was used when the object was created so that it can compare the current in
use pointer with what existed when the object was created.  In the case where
they match the operation is permitted to continue, otherwise an exception is
throw, thus avoiding a segmentation fault.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:27 -06:00
Tony Asleson
1f744733a1 python-lvm: Correct names
The existing names do not follow accepted guidelines.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:25 -06:00
Zdenek Kabelac
b0b061cdbc tests: skip raid test on 3.12.0
3.12.0 kernel prevents raid test to be usable,
leaving unremovable devices in table.

This needs to be fixed ASAP, meanwhile disable test to make
test machines at least usable.
2013-11-19 11:49:33 +01:00
Zdenek Kabelac
fe609141a8 tests: on 32bit test with <16T devs
Add  'can_use_16T' to detect systems where we could
safely use 16T devices without causing system deadlocks.

16T size leads on those to endless loops in udevd
- it calls blkid which tries cached read from such device
- this ends in endless loop.

Related problems:
https://bugzilla.redhat.com/show_bug.cgi?id=1015028
2013-11-19 10:55:14 +01:00
Zdenek Kabelac
c697f501c7 Makefile: fix build in non src dir
Fix 'make install' from builddir != srcdir.
2013-11-19 10:55:11 +01:00
Petr Rockai
3a6f91d713 metadata: Make the fid mda routines a little more resilient. 2013-11-18 18:00:49 +01:00
Petr Rockai
03d3e1d9c1 lvmetad: Set up device pointers in synthetic lvmcache_infos. 2013-11-18 17:53:45 +01:00
Petr Rockai
b8a6b8f467 test: Force label-based reporting in pv-duplicate.sh. 2013-11-18 17:53:06 +01:00
Petr Rockai
ae337d472e report: Print UUIDs for missing PVs when possible. 2013-11-17 22:36:13 +01:00
Petr Rockai
ecc296311f metadata: Do not throw an error in pv_label for missing PVs. 2013-11-17 22:35:16 +01:00
Petr Rockai
a5bb1b48ee dev-cache.c: Make dev_name a little more robust. 2013-11-17 22:34:56 +01:00
Petr Rockai
71b6565529 report: Convert pv_mda_size to a type "label" field. 2013-11-17 21:43:06 +01:00
Petr Rockai
14ffc9d4df reporter: Adapt pvseg reporting to label-type fields. 2013-11-17 21:43:06 +01:00
Petr Rockai
2294282184 reporter: Deal correctly with dummy PVs/labels. 2013-11-17 21:43:06 +01:00
Petr Rockai
d5095222fa toollib: Report errors on non-PV arguments to process_each_label. 2013-11-17 21:43:06 +01:00
Petr Rockai
67c563ac2b pv_label: NULL result is not always an internal error. 2013-11-17 21:43:06 +01:00
Petr Rockai
a8aa8d4b5c report: Make PV UUID into a "label" type field. 2013-11-17 21:43:06 +01:00
Petr Rockai
67a7b7a87d report: Iterate over labels instead of PVs for label-only reports. 2013-11-17 21:43:06 +01:00
Petr Rockai
99214c51eb report: Make PMdaFree into a "label" field. 2013-11-17 21:43:06 +01:00
Petr Rockai
b07fb3a641 report: Adapt _pvfmt_disp to label-based reporting. 2013-11-17 21:43:04 +01:00
Petr Rockai
7e33f50cea report: Add a proper "label" field type. 2013-11-17 21:41:27 +01:00
Petr Rockai
6b41e916ff report: Make dev_size and dev_name columns' type "label". 2013-11-17 21:41:27 +01:00
Petr Rockai
cc633c84cf label: Track a device pointer in struct label. 2013-11-17 21:41:27 +01:00
Petr Rockai
dc3a071145 metadata: Add a pv_label accessor (go from a PV to its label). 2013-11-17 21:41:27 +01:00
Petr Rockai
a2034e9a99 metadata: Add lvmcache_info_mda_free as a companion to pv_mda_free. 2013-11-17 21:41:27 +01:00
Petr Rockai
1ef2c3c4ee toollib: Implement process_each_label. 2013-11-17 21:41:27 +01:00
Petr Rockai
9b91977f4e labeller: Make the use of "private" as "fmt" explicit.
All labellers always use the "private" (void *) field as the fmt pointer. Making
this fact explicit in the type of the labeller simplifies the label reporting
code which needs to extract the format. Moreover, it removes a number of
error-prone casts from the code.
2013-11-17 21:41:27 +01:00
Petr Rockai
bead8ef5f0 metadata: Nuke the exported "pv_read" function. 2013-11-17 21:41:27 +01:00
Petr Rockai
ba6d6f0028 metadata: Fix handling of orphan PV linking & re-linking. 2013-11-17 21:41:27 +01:00