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

7183 Commits

Author SHA1 Message Date
Zdenek Kabelac
c7c53ad41d pvcreate: fix leak on error path
Missing vg release on error path.
Add tests for few more error cases.
2012-10-19 15:32:21 +02:00
Andy Grover
0e47639a44 python-lvm: Implement proper refcounting for parent objects
Our object nesting:

lib -> VG -> LV -> lvseg
          -> PV -> pvseg

Implement refcounting and checks to ensure parent objects are not
dealloced before their children. Also ensure calls to self or child's
methods are handled cleanly for objects that have been closed or removed.

Ensure all functions that are object methods have a first parameter named
'self', for consistency

Rename local vars that reference a Python object to '*obj', in order to
differentiate from liblvm handles

Fix a misspelled pv method name

Signed-off-by: Andy Grover <agrover@redhat.com>
2012-10-17 12:55:25 -07:00
Zdenek Kabelac
bf2741376d Use lv_is_active instead of lv_info()
Usage of lv_is_active makes it more obvious what is being checked.
2012-10-17 15:42:31 +02:00
Zdenek Kabelac
e431b19bac cleanup: move log_error upward in code stack
Report log_error earlier.
2012-10-17 15:41:44 +02:00
Zdenek Kabelac
f260f99d57 cleanup: switch log_error to log_warn
Use log_warn to print non-fatal warning messages.

Use of log_error would confuse checker for testing
whether proper error has been reported for some real error.
2012-10-17 15:41:35 +02:00
Zdenek Kabelac
b89963a7c3 cleanup: swap return values
Use lvm standard return code for success/fail  1/0.
2012-10-17 15:37:26 +02:00
Tony Asleson
10ba799ab0 python-lvm: Update example to work with lvm object removal.
Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
2012-10-15 14:11:10 -07:00
Andy Grover
12b631a676 python-lvm: whitespace and Yoda conditionals
Signed-off-by: Andy Grover <agrover@redhat.com>
2012-10-15 14:11:10 -07:00
Andy Grover
84a4d4b970 python-lvm: Remove liblvm object
Instead of requiring users to create a liblvm object, and then calling
methods on it, the module acquires a liblvm handle as part of
initialization. This makes it impossible to instantiate a liblvm object
with a different systemdir, but there is an alternate envvar method for
that obscure use case.

Signed-off-by: Andy Grover <agrover@redhat.com>
2012-10-15 14:11:10 -07:00
Jonathan Brassow
831ce3cda9 TEST: Re-add testing of lvconvert-raid for kernels < 3.2
I'm not sure what 'BUG's were being encountered when the restriction
to limit lvconvert-raid.sh tests to kernels > 3.2 was added.  I do know
that there were BUG's that could be triggered when testing snapshots and
some of the earliest DM RAID available in the kernel.  I've taken out
the 3.2 kernel restriction and added a dm-raid >= 1.2 restriction instead.
This will allow the test to run on patched production kernels.
2012-10-15 15:43:15 -05:00
Jonathan Brassow
67379a3ffd RAID: Add "raid10" to lvcreate man page.
In addition to reference to raid10 under the '--type' argument, an
example creating a RAID10 LV has been added.
2012-10-15 15:41:14 -05:00
Jonathan Brassow
7519d881ef Clean-up: Adjust message to be clearer on action taken and why
A message is printed when the region_size of a RAID LV is adjusted
to allow for large (> ~1TB) LVs.  The message wasn't very clear.
Hopefully, this is better.
2012-10-15 15:09:05 -05:00
Alasdair G Kergon
ea6a8078b4 release: prepare for release 2012-10-15 15:19:32 +01:00
Peter Rajnoha
5afa2ffcaa scripts: blk-availability - use full name for clarity
"Stopping blk-availability" -> "Stopping block device availability:"
2012-10-15 16:10:58 +02:00
Peter Rajnoha
3ff080c591 libdm: fix comments in libdevmapper.h 2012-10-15 15:40:37 +02:00
Alasdair G Kergon
8290de964f lvmetad: rename DEBUG() to DEBUGLOG()
DEBUG is already defined by -DDEBUG
2012-10-15 14:20:11 +01:00
Alasdair G Kergon
895ee61642 Makefiles: fix distclean dir dependency
test distclean uses tools so must distclean tools after test
2012-10-15 14:15:59 +01:00
Peter Rajnoha
d365bfe7e9 scripts: blk-availability should be stopped before FCoE 2012-10-15 15:00:12 +02:00
Zdenek Kabelac
d864c6eacd test: resync is for mirror devices 2012-10-15 14:31:41 +02:00
Zdenek Kabelac
4573877186 lvchange: resync returns error on usupported volumes 2012-10-15 14:09:37 +02:00
Zdenek Kabelac
b3899056d9 thin: disable conversion of thin-pool to read-only
This change is not yet supported.
2012-10-15 14:09:11 +02:00
Zdenek Kabelac
faa9a52085 test: detect compilation with readline
check lvm shell functionality only if compiled with readline.
2012-10-15 14:07:06 +02:00
Zdenek Kabelac
2fc1fc3a93 thin: allow to create read-only thin-volumes
Useful for i.e. read-only thin snapshots.
2012-10-15 14:07:03 +02:00
Peter Rajnoha
c93659e0e0 scripts: blk-availability - use the same name for lock file 2012-10-15 13:22:36 +02:00
Peter Rajnoha
4dace48f51 Remove pvscan --cache from lvm2-lvmetad init script.
This is not needed anymore as the scan is called transparently
within the first LVM command that queries lvmetad.
2012-10-15 12:58:23 +02:00
Petr Rockai
08ba1b4472 lvmetad: Only print scanning messages when scanning 1 device. 2012-10-15 12:45:50 +02:00
Alasdair G Kergon
78dafcba99 lvmetad: use -l for logging level not -d 2012-10-15 10:44:43 +01:00
Zdenek Kabelac
3ed2c32e0a lvmetad: empty types string is ok
Since now return code is test - return OK for this case.
2012-10-15 11:02:15 +02:00
Alasdair G Kergon
a0e60d27ff lvmetad: document and tidy cmdline args
Try to bring the lvmetad usage text and man page closer to the code.
There seem to be 3 useful ways to use -d with lvmetad at the moment:
  -d all
  -d wire
  -d debug
(They can also be comma-separated like -d wire,debug.)
Prior to the last release, -d, -dd and -ddd were supported.
Fail if an unrecognised debug arg is supplied on the command line.
Change -V to report the same version as the lvm binary: previously it
just reported version 0.
2012-10-15 02:06:27 +01:00
Zdenek Kabelac
2393b468a4 lvmetad: fix previous commit
Ooops patch conversion for gcc cleanup missed this line.
2012-10-15 00:44:31 +02:00
Zdenek Kabelac
9bb210192d cleanup: readable test to check for 32bit overflow
also swap return value 0 - fail, 1 - success.
2012-10-14 23:19:27 +02:00
Zdenek Kabelac
3972bd98fb thin: add support to unmount volumes
Reset counter after thin pool resize failure.

If the pool goes above threshold, support unmounting
of all thin volumes if the lvextend fails to avoid
overfilling of the pool.
2012-10-14 23:19:20 +02:00
Zdenek Kabelac
c6f2821b9f test: speedup a bit
Do not wait full 10s if the invalid snapshot is already dropped.
2012-10-14 23:17:33 +02:00
Zdenek Kabelac
16060b101b thin: lvextend will fail is autoextend is 0%
Since extending by 0% will not increase the size of pool,
return failure.
2012-10-14 23:17:30 +02:00
Zdenek Kabelac
a6f53b5c0d test: coverage
Improve a bit code coverage.
Use lvm shell to reduce a bit CPU time.
2012-10-14 23:14:48 +02:00
Zdenek Kabelac
920352da70 lvmetad: fix leak of append on error path 2012-10-14 23:14:48 +02:00
Zdenek Kabelac
6595cae6e9 cleanup: resolve dereferencing type-punned pointer
fix gcc warning:
dereferencing type-punned pointer will break strict-aliasing rules
Replace call by value and pass just const pointer to pvid.
2012-10-14 23:14:00 +02:00
Zdenek Kabelac
4379365cae lvmetad: fix memory leaks in error paths
Destroy interator in error path.
Releasy any possible allocated buffer from buffer_append_f
and buffer_append_vf  in error path.
2012-10-13 19:19:50 +02:00
Zdenek Kabelac
5df6ec24bf cleanup: used old C standard 2012-10-13 19:18:33 +02:00
Zdenek Kabelac
9effc6ab31 cleanup: drop unused assignment
Since 'n' is later reassigned and unused between, drop it's first
assign.
2012-10-13 19:17:10 +02:00
Zdenek Kabelac
88c547d1ca lvmetad: move initialization in the inner loop
Set append to NULL in the front of cycle, so the INTERNAL error path
is not leading to double-free of append pointer.
2012-10-13 19:15:15 +02:00
Zdenek Kabelac
7c7ab99843 cleanup: add gcc printf __attribute__ 2012-10-13 19:14:41 +02:00
Zdenek Kabelac
feea5003cc cleanup: remove unneeded headers
Header do not provide any needed symbols.
2012-10-13 19:13:25 +02:00
Zdenek Kabelac
98124361ae test: update global_filter
use simplier filter for test suite
2012-10-12 17:59:11 +02:00
Zdenek Kabelac
bb867abe11 test: typo fix from last commit 2012-10-12 17:35:44 +02:00
Zdenek Kabelac
45b1fcdb4e test: move global_filter only to mdata_string test
Tries to help with lvmetad test and pvdisplay and unknown device.
2012-10-12 17:27:29 +02:00
Zdenek Kabelac
0f155e699c lvmetad: release_token without lvmetad
Missing wrapper when not building with lvmetad support
2012-10-12 17:16:28 +02:00
Zdenek Kabelac
d9cc3f3acb test: use global_filter with initial content 2012-10-12 17:02:30 +02:00
Zdenek Kabelac
31d8c3ee85 debug: do not play with fds with valgring
When valgrind usage is desired by user (--enable-valgrind-pool)
skip playing/closing/reopenning with descriptors - it makes
valgridng useless.

Make sleep delay for clvmd start longer.
2012-10-12 17:02:30 +02:00
Zdenek Kabelac
ee7143cd02 lvmetead: release token
Release allocated memory when destroing toolcontext
2012-10-12 17:01:22 +02:00