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

8246 Commits

Author SHA1 Message Date
Zdenek Kabelac
b8f72c0f2c cleanup: use const format 2013-11-22 21:00:56 +01:00
Zdenek Kabelac
62db5c1e48 cleanup: make gcc happier with initializers
Whole struct will be set to 0, just
if the first member is array, gcc gives warning
we should initialized this element as array,
so pick any later simple type.
2013-11-22 21:00:56 +01:00
Zdenek Kabelac
6ebbf19828 cleanup: drop unused header
Header is not used here.
2013-11-22 21:00:56 +01:00
Zdenek Kabelac
07d766d270 cleanup: use string directly 2013-11-22 21:00:55 +01:00
Zdenek Kabelac
3e0fb102de cleanup: simplify pv uuid display
Shorter code with explicit type casting.
2013-11-22 21:00:55 +01:00
Zdenek Kabelac
bea118a87c cleanup: use safe iterator
Simplify code and use dm_list_iterate_items_safe() and avoid
scanning the list mutliple times.
Use dm_list_move().
2013-11-22 21:00:55 +01:00
Zdenek Kabelac
19cc92230c cleanup: use trigraph
Shorter code...
2013-11-22 21:00:55 +01:00
Zdenek Kabelac
879ea38c53 dmeventd: drop duplicated code
Do not call pthread_attr_init() twice.
The second call has all proper tests.
2013-11-22 21:00:55 +01:00
Zdenek Kabelac
1ff53bb7b6 snapshot: code move
Move some code lines in front, they will be shared with thin snapshot
merge later.
2013-11-22 21:00:55 +01:00
Zdenek Kabelac
30c127eaf8 fix missing header 2013-11-22 21:00:55 +01:00
Zdenek Kabelac
b4fc397de6 do_flock: mark descriptor as closed
Keep the structure content valid in error path
and mark descriptor as closed (-1).
2013-11-22 21:00:55 +01:00
Zdenek Kabelac
782a356e7c archiver: add check for dm_pool_strdup
It will likely not fail to duplicate empty string, but
just keep the test of result of this function consistent.

Also on error path restore extent_size if in some
case someone would still use that variable.
2013-11-22 21:00:54 +01:00
Zdenek Kabelac
d079c81ab4 dev-type: use text format as direct arg for printf
Put common printf() case into a function and use
the string with text format as direct arg to make
the compile time validation of args easier and
code shorter.

Switch log_error() to log_warn(), since 'return 0'
doesn't cause any failure here.
2013-11-22 21:00:54 +01:00
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