1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
Commit Graph

253 Commits

Author SHA1 Message Date
Alasdair Kergon
f2e3d659ea lp.pool may be (null) too 2012-02-01 01:54:20 +00:00
Zdenek Kabelac
4fbde0143a Support rounding of percentage upward
We want to keep this logic -
when LV is extend - extend the LV by at least given amount,
when LV is reduced - reduce the LV by at most given amount.

So for this the rounding needs to be used.
Current logic which seems to satisfy give rule is to round up all
extent values for LV resize upward except for values with '-' sign
that are round downward.

This patch also fixes the problem when  lvextend --use-polices tried
to extend LV the by i.e. 20% - but the resulting 20% were smaller
the extent size thus before this patch no extension happened.
2012-01-05 15:38:18 +00:00
Zdenek Kabelac
f582793f1b Thin rename internal thin pool segment
Use matching name as kernel target - useful when function like
_percent is using this for validation.
2011-12-21 12:54:19 +00:00
Zdenek Kabelac
6e89eb9a52 Small comment and indent updates 2011-11-10 12:43:05 +00:00
Zdenek Kabelac
a538e369db Thin move _read_activation_params check
Since we finaly recognize thin creation only after
_determine_snapshot_type() - move _read_activation_params()
after it - so we can support  lvcreate -an thin snapshot.
2011-11-10 12:40:29 +00:00
Zdenek Kabelac
95308c5f58 Thin create normal (old) snapshot when size is specified 2011-11-10 12:39:46 +00:00
Zdenek Kabelac
97d7e5aedb Thin supports snapshots
Full support for thin snapshots.
Create and remove is supported.

TODO: lvconvert support is not yes available.
2011-11-07 11:03:47 +00:00
Zdenek Kabelac
e903e37d0a Add missing default LVM_VG_NAME
Add support for exported shell variable LVM_VG_NAME also
for thins and snapshots.
2011-11-07 11:01:53 +00:00
Zdenek Kabelac
b8cac455bd Thin supports poolmetadatasize setting
Add option to set pool metadatasize.
For passing size parameter reuse region_size.
2011-11-04 22:43:10 +00:00
Zdenek Kabelac
3bc417488d Thin pool now support chunk size as well
Use chunksize option to specify data_block_size for thin pool target.
Drop low_water_mark to zero.
2011-10-21 09:55:07 +00:00
Alasdair Kergon
0ed2af7fb1 better -m0 error message, but there's an internal logic error to fix instead 2011-09-27 12:37:07 +00:00
Jonathan Earl Brassow
f989a55539 Disallow the creation of mirrors (mirror or raid1 segtype) with only one leg.
If you specify the segment type (e.g. --type mirror) and the mirrors argument
as zero, it would result in a mirrored LV with only one image.  While the device
may be valid in theory, it should not be allowed in practice.  It also makes it
difficult on the conversion tools, since they react badly to single-image
mirrors.
2011-09-22 15:36:21 +00:00
Milan Broz
b18e1fd50e Fix possible overflow of size if %FREE or %VG is used.
https://bugzilla.redhat.com/show_bug.cgi?id=737087
2011-09-15 15:26:40 +00:00
Alasdair Kergon
ef78ebf35a lvcreate/remove thin_pool and thin volumes (--driverloaded n only) 2011-09-08 16:41:18 +00:00
Zdenek Kabelac
0d505fb408 Check if lp.origin exists
Currently needed for _determine_snapshot_type().
2011-09-07 09:25:51 +00:00
Alasdair Kergon
bb6f9b10db pool attach fns & more field renaming 2011-09-06 22:43:56 +00:00
Alasdair Kergon
b88362ff95 add thin_manip.c like the other manip files
move basic lv_is_* to macros
data_lv -> pool_lv - we decided to call it 'pool' everywhere now
2011-09-06 19:25:42 +00:00
Alasdair Kergon
e866a22916 only thin volumes need converting 2011-09-06 15:35:11 +00:00
Alasdair Kergon
9ac61d2ba2 lvcreate parsing for thin provisioning.
The rest is incomplete so this isn't usable yet.
2011-09-06 00:26:42 +00:00
Alasdair Kergon
d8b1aa198b more pre-release fixes 2011-08-12 02:16:46 +00:00
Zdenek Kabelac
077a6755ff Replace free_vg with release_vg
Move the free_vg() to  vg.c  and replace free_vg  with release_vg
and make the _free_vg internal.

Patch is needed for sharing VG in vginfo cache so the release_vg function name
is a better fit here.
2011-08-10 20:25:29 +00:00
Jonathan Earl Brassow
cac52ca4ce Add basic RAID segment type(s) support.
Implementation described in doc/lvm2-raid.txt.

Basic support includes:
- ability to create RAID 1/4/5/6 arrays
- ability to delete RAID arrays
- ability to display RAID arrays
Notable missing features (not included in this patch):
- ability to clean-up/repair failures
- ability to convert RAID segment types
- ability to monitor RAID segment types
2011-08-02 22:07:20 +00:00
Alasdair Kergon
453cdee51c Permit --available with lvcreate so non-snapshot LVs need not be activated. 2011-06-01 19:21:03 +00:00
Jonathan Earl Brassow
09c4fd3f55 cosmetic change - swapping one macro for another
When I see 'seg_is_mirrored', I expect the argument to be an lv_segment.
In this case, it is lvcreate_params.  Both structures, have a 'segtype'
entry which the macro dereferences.  However, it just seems easier to
understand if we do 'segtype_is_mirrored' instead.
2011-03-25 21:56:28 +00:00
Zdenek Kabelac
aec2115410 Const fixing
Fixing some const warnings - with API change in:

int vg_extend(struct volume_group *vg, int pv_count, const char *const *pv_names,

Change is needed - as lvm2api expects const behaviour here.
So vg_extend() is doing local strdup for unescaping.

skip_dev_dir return const char* from const char* vg_name.

Rest of the patch is cleanup of related warnings.

Also using dm_report_filed_string() API change to simplify
casting in _string_disp and _lvname_disp.
2011-02-18 14:47:28 +00:00
Jonathan Earl Brassow
025e69a15a Add disk to mirrored log type conversion. 2011-01-11 17:05:08 +00:00
Alasdair Kergon
2b82bd79f5 Rename vg_release to free_vg. 2010-12-08 20:50:48 +00:00
Petr Rockai
8191fe4f4a Refactor the percent (mirror sync, snapshot usage) handling code to use
fixed-point values instead of a combination of a float value and an enum.
2010-11-30 11:53:31 +00:00
Alasdair Kergon
f8452d8cfd Support repetition of --addtag and --deltag arguments.
Add infrastructure for specific cmdline arguments to be repeated in groups.
Split the_args cmdline arguments and values into arg_props and arg_values.
2010-11-11 17:29:05 +00:00
Zdenek Kabelac
fc218865bf Ensure we always have origin defined
Reported by clang as: Logic error Dereference of null pointer
Make sure the code path could not use NULL origin because of some internal
code error.
2010-10-25 12:05:46 +00:00
Alasdair Kergon
08f1ddea6c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
Jonathan Earl Brassow
dfafb8fb20 If we are checking if '--nosync' was called with the mirror argument,
then let's also check if '--mirrorlog' was called with the mirror
argument.
2010-05-11 21:40:11 +00:00
Alasdair Kergon
54d7741a3e Remove no-longer-used arg_ptr_value.
Fix -M and --type to use strings not pointers that change on config refresh.
2010-04-29 01:38:12 +00:00
Alasdair Kergon
68176be18e Add --stripes to lvconvert too. 2010-04-13 01:54:32 +00:00
Alasdair Kergon
1485ce69c4 Permit mimage LVs to be striped in lvcreate and lvresize. 2010-04-09 01:00:10 +00:00
Mike Snitzer
b73c18242e Do not allow {vg|lv}change --ignoremonitoring if on clustered VG.
clvmd does not propagate DMEVENTD_MONITOR_IGNORE.

Update get_activation_monitoring_mode() to check if the VG that the
LV is being activated in is clustered.  If so, skip it.

Any get_activation_monitoring_mode() error will cause the associated LV
(or VG) to be skipped during activation.  Both vgchange_single() and
lvchange_single(), which call get_activation_monitoring_mode(), are
called by their respective process_each_..() method.
2010-03-29 16:09:40 +00:00
Jonathan Earl Brassow
7a369d3704 Add ability to create mirrored logs for mirror LVs.
This check-in enables the 'mirrored' log type.  It can be specified
by using the '--mirrorlog' option as follows:
#> lvcreate -m1 --mirrorlog mirrored -L 5G -n lv vg

I've also included a couple updates to the testsuite.  These updates
include tests for the new log type, and some fixes to some of the
*lvconvert* tests.
2010-03-26 22:15:43 +00:00
Mike Snitzer
a6bc975a24 Improve activation monitoring option processing
. Add "monitoring" option to "activation" section of lvm.conf
. Have clvmd consult the lvm.conf "activation/monitoring" too.
. Introduce toollib.c:get_activation_monitoring_mode().
. Error out when both --monitor and --ignoremonitoring are provided.
. Add --monitor and --ignoremonitoring support to lvcreate.  Update
  lvcreate man page accordingly.
. Clarify that '--monitor' controls the start and stop of monitoring in
  the {vg,lv}change man pages.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-03-23 22:30:18 +00:00
Mike Snitzer
5bc2af2688 Add %ORIGIN support to lv{create,extend,reduce,resize} --extents option
Allow the number of logical extents to be expressed (for a snapshot) as
a percentage of the total space in the Origin Logical Volume with the
suffix %ORIGIN.

Update the relevant man pages accordingly.  Eliminate inconsistencies
between the man pages and tools/commands.h

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-02-03 03:58:08 +00:00
Alasdair Kergon
f3ac7d1b82 Revert so-called "redundant" log until after next release. 2010-01-12 14:00:51 +00:00
Jonathan Earl Brassow
77dd1c0e5f Add the new mirror log type "redundant". The options are now:
--mirrorlog core: in-memory log
--mirrorlog disk: persistent log
--mirrorlog redundant: redundant persistent log

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2010-01-08 22:32:35 +00:00
Dave Wysochanski
c053fb62bc Fix setting of readahead in lvcreate.
The default comes from the configuration settings, with possible
commandline override.
2009-12-03 01:47:33 +00:00
Milan Broz
5800aa5c07 Do not allow creating mirrors of more than 8 images.
This is kernel limitation in all kernel versions,
so better detect this early.
2009-11-27 14:35:38 +00:00
Milan Broz
ba3851fda6 Fix lvcreate processing of %PVS argument.
- fix missing unlocking of VG
lvcreate -l 100%PVS -n lv1 vg_test
  Please specify physical volume(s) with %PVS
  Internal error: Volume Group vg_test was not unlocked

- if no PVS specified, use all available

Fix segfault if %PVS in lvresize without PVs list.
2009-11-04 14:47:27 +00:00
Alasdair Kergon
a8fb89adaf Tidy some uses of arg_count and introduce arg_is_set. 2009-11-03 15:50:42 +00:00
Alasdair Kergon
651ff9b328 Add lots of missing stack debug messages to tools.
Make readonly locking available as locking type 4.
Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49)
2009-09-14 22:47:49 +00:00
Dave Wysochanski
9963d0710e Move extents_from_size from lvcreate into internal library so we can reuse.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 02:34:09 +00:00
Dave Wysochanski
c42b235610 Move _lvcreate into the internal library and rename to lv_create_single.
After some refactorings, we can now move the bulk of _lvcreate into the
internal library, and we can call from liblvm.  In the future, we should
refactor lv_create_single further, probably by segtype, to reduce the
size of struct lvcreate_params.  For now this is a reasonable refactor
and allows us to re-use the function from liblvm.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 02:33:35 +00:00
Dave Wysochanski
e6479dff9f Move pvs and pv_count fields from lvcreate_params to lvcreate_cmdline_params.
No functional change.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 02:32:50 +00:00
Dave Wysochanski
81779abd54 Comment lvcreate_params struct.
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-07-26 02:32:26 +00:00