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

8502 Commits

Author SHA1 Message Date
Zdenek Kabelac
6e2f706233 cleanup: use struct initializer 2014-02-15 11:36:53 +01:00
Zdenek Kabelac
a508786664 cleanup: indent spaces 2014-02-15 11:36:53 +01:00
Zdenek Kabelac
c651c614ec cache: using unsigned argc
Convert using unsigned for _argc.
2014-02-15 11:36:53 +01:00
Zdenek Kabelac
da268eb4cc cache: convert libdm to use plain function call
Avoid introducing libdm structure allocated in library user.
Use direct call with all currently supported args.
When new arg is added, new function will cover it.
2014-02-15 11:36:53 +01:00
Zdenek Kabelac
7ec8e691c4 libdm: use 64bit type for raid index
Used properly signed 64bit constant for shifting.
2014-02-15 11:36:37 +01:00
Zdenek Kabelac
f0f4248333 activation: drop test r/w vg state for activing LV
VG status read/write is meant to influence only VG metadata.
It's not related to the read/write status of the LV itself.
2014-02-15 11:34:54 +01:00
Jonathan Brassow
fa4812bf7b cache: Fix cache LV not being instantiated in kernel
When an origin exists and the 'lvcreate' command is used to create
a cache pool + cache LV, the table is loaded into the kernel but
never instantiated (suspend/resume was never called).  A user running
LVM commands would never know that the kernel did not have the
proper state unless they also ran the dmsetup 'table/status' command.
The solution is to suspend/resume the cache LV to make the loaded
tables become active.
2014-02-14 16:04:31 -06:00
Peter Rajnoha
554159d519 systemd: do not use default dependencies for clvmd/cmirrord units
Do not use default dependencies that systemd adds to the units
so we have better control of when the service is started/stopped
and we don't end up with unexpected behaviour.
2014-02-14 14:37:19 +01:00
Peter Rajnoha
4210219a8b systemd: Use --ignoreskippedcluster in generated activation systemd units
When the activation units are generated if use_lvmetad=0 (no
autoactivation), use --ignoreskippedcluster option for vgchange calls
since the cluster with cLVM is set up by separate units.

This avoids a situation in which the generated activation units are
improperly in failed state just because of the vgchange return value
when clustered VGs are encountered while the activation of non-clustered
VGs does proceed normally.
2014-02-14 11:59:12 +01:00
Jonathan Brassow
94d8779ae2 Update WHATS_NEW for approximate allocation check-in 2014-02-13 21:12:28 -06:00
Jonathan Brassow
4b6e3b5e5e allocation: Allow approximate allocation when specifying size in percent
Introduce a new parameter called "approx_alloc" that is set when the
desired size of a new LV is specified in percentage terms.  If set,
the allocation code tries to get as much space as it can but does not
fail if can at least get some.

One of the practical implications is that users can now specify 100%FREE
when creating RAID LVs, like this:
~> lvcreate --type raid5 -i 2 -l 100%FREE -n lv vg
2014-02-13 21:10:28 -06:00
Jonathan Brassow
f4658b53d7 man: Add example/explanation section for cache LVs to lvm.8
I've added an "Advanced Logical Volume Types" section that I hope
to contain information on the logical volume types that may use
multiple steps and multiple commands to create.  Cache is the
first entry into this section.  I'd like to see thin and RAID in
here in the future.
2014-02-13 11:53:31 -06:00
Jonathan Brassow
907641cd3d cache: Update man page to reflect need for dm-cache 1.3.0
Update the man page so the user knows that dm-cache 1.3.0 module
is needed.  Also, enforce that in the code and print a warning if
the module is not new enough.
2014-02-13 09:13:57 -06:00
Marian Csontos
a060b3b390 Fix premature return from get_pool_params 2014-02-13 10:50:56 +01:00
Jonathan Brassow
e8225b8615 cache: Do not configure cache[pool] support by default
Users wanting cache[_pool] segment type support need to include
"--with-cache=internal" when configure'ing.
2014-02-12 10:58:20 -06:00
Jonathan Brassow
5bfe4aaf95 cache[pool]: Man page updates for lvs, lvcreate, lvconvert 2014-02-12 10:29:07 -06:00
Jonathan Brassow
0912cf67aa cache: Ability to convert an existing LV into a cached LV
Users now have the ability to convert their existing logical volumes
into cached logical volumes.  A cache pool LV must be specified using
the '--cachepool' argument.  The cachepool is the small, fast LV used
to cache the large, slow LV that is being converted.
2014-02-12 09:55:35 -06:00
Jonathan Brassow
c8b6c4aee9 cachepool: Ability to convert existing LVs to cachepool type
This patch allows users to convert existing logical volumes into
cache pool LVs.  Since cache pool LVs consist of data and metadata
sub-LVs, there is also the '--poolmetadata' (similar to thin_pool)
which allows for the specification of the metadata device.
2014-02-12 09:51:42 -06:00
Jonathan Brassow
48aef76ec5 cache: lv_cache_create returns LV ptr, so return NULL not 0 on error 2014-02-11 13:47:26 -06:00
Zdenek Kabelac
d68e5d5ab9 tests: utilize check and get
Replace some in-test use of lvs commands with their check
and get equivalent.

Advantage is these 'checking' commands are not necessarily always
valiadated via extensive valgrind testing and also the output noice
is significantly reduces since the output of check/get is suppressed.
2014-02-11 19:00:07 +01:00
Zdenek Kabelac
177db48c11 tests: add check lv_not_exists 2014-02-11 19:00:06 +01:00
Zdenek Kabelac
4ed831e7ef tests: remove debug.log in enable_dev
In aux functions we may drop debug log from
last running lvm command - so we do not
get debug log from properly executed command,
when we fail here.
2014-02-11 19:00:06 +01:00
Zdenek Kabelac
108ae0edc6 cleanup: fix some lvm.conf typos 2014-02-11 19:00:06 +01:00
Zdenek Kabelac
9d69585b82 cleanup: remove unneeded header files 2014-02-11 19:00:06 +01:00
Zdenek Kabelac
e5d59d9618 cleanup: use string constant with '_' 2014-02-11 19:00:06 +01:00
Zdenek Kabelac
f86e18bfeb cleanup: condition reodering
Check SEG_CANNOT_BE_ZEROED before even calling arg_str_value which
is not needed in this case.

Set it to 1 or 0 and not just result of strcmp call.
2014-02-11 19:00:06 +01:00
Zdenek Kabelac
bcd6b643be cleanup: update clearing message
Since some targets are using this routine to setup
other values then 0 and also may clear much more data then
just disk header - add better message.
2014-02-11 18:59:22 +01:00
Zdenek Kabelac
40a9c443a9 man: use some existing indentifier
Avoid confusing user, since some may get impression there is
such variable (max_archives) in the config file.
Pick rather something existing.
2014-02-11 18:55:54 +01:00
Zdenek Kabelac
c1faa4048a lvm2app: access params after its checked
Since params is checked for NULL, move code that dereferences
params after its check.
2014-02-11 18:50:37 +01:00
Zdenek Kabelac
38e457c478 raid: drop invalid modication of active parameter
lv_active_change will enforce proper activation.
Modification of activation was wrong and lead to misuse of
autoactivation. Fix allows to use proper local exclusive activation,
while the removed code turned this into just exclusive
activation (losing required local property).
2014-02-11 18:48:38 +01:00
Zdenek Kabelac
8a21dcebac raid: use unsigned 64b constant for shift 2014-02-11 18:47:15 +01:00
Peter Rajnoha
1a5062c9a7 cleanup: clarify man pages about lvchange/vgchange -aay, use -aay in lvm2-cluster-activation script 2014-02-11 13:48:04 +01:00
Peter Rajnoha
a092cd33be systemd: rename lvm2-cluster-activation and lvm2-clvmd services to follow existing naming
lvm2_cluster_activation_red_hat.service.in -> lvm2_cluster_activation_systemd_red_hat.service.in
lvm2_clvmd_red_hat.service.in -> lvm2_clvmd_red_hat.service.in

Edit lvm2-cluster-activation reference on cmirror - take new
lvm2-cmirrord.service, it was just cmirrord(.service) before
as the old initscript was used in compatibility mode.

Also, use WantedBy=multi-user.target instead of sysinit.target
in lvm2-cluster-activation.service.
2014-02-11 10:12:39 +01:00
Peter Rajnoha
ef91de2a0c systemd: add systemd unit for cmirrord 2014-02-11 10:06:19 +01:00
Peter Rajnoha
a0d64554e6 autoreconf: latest changes 2014-02-10 19:02:18 +01:00
Ondrej Kozina
fd41dd8f9c Add systemd native service for clvmd and cluster activation
The commit splits original clvmd service in two new native services
for systemd enabled systems while original init scripts remain unaltered.

New systemd native services:

  1) clvmd daemon itself (lvm2_clvmd_red_hat.service.in)
  2) (de)activation of clustered VGs (lvm2_cluster_activation_red_hat.service.in)

There're several reasons to split it. First, there's no support for conditional
stop in systemd and AFAIK they don't plan to support it. In other words:
if the deactivation fails for some reason, systemd doesn't care and will simply
kill all remaining processes in original cgroup (by default). Killing the
remaining procs can be suppressed however it doesn't solve the following problem:

You can't repeat the stop command of a failed service. The repeated stop command
is simply not propagated to the service in a failed state. You would have to start
and then try to stop the service again. Unfortunately, this can't be done while
the daemon is still running (and we need the daemon to stay active until all
clustered VGs are deactivated properly).

In a separated setup we need only to restart the failed activation service and
that's fine.
2014-02-10 17:13:49 +01:00
Peter Rajnoha
ffa623c53d systemd: cleanup for lvmetad systemd unit
No need to fork lvmetad when running under systemd.
Also, the "lvmetad -R" support has been removed in lvm2 v2.02.98
so remove the ExecReload line that called it on "systemctl reload".
2014-02-10 16:20:45 +01:00
Petr Rockai
38457e1be9 libdevmapper-event: Print a deprecation warning for non-default plugins. 2014-02-10 14:52:59 +01:00
Peter Rajnoha
ed166a3b1d wiping: wipe DM_snapshot_cow signature without prompt in newly created LVs
The libblkid can detect DM_snapshot_cow signature and when creating
new LVs with blkid wiping used (allocation/use_blkid_wiping=1 lvm.conf
setting and --wipe y used at the same time - which it is by default).

Do not issue any prompts about this signature when new LV is created
and just wipe it right away without asking questions. Still keep the
log in verbose mode though.
2014-02-10 13:28:13 +01:00
Peter Rajnoha
5635816094 cleanup: missing parentheses in a condition
gcc reports:
  metadata/merge.c:229:58: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  metadata/merge.c:232:58: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
2014-02-10 09:05:17 +01:00
Peter Rajnoha
290e58b0b6 WHATS_NEW: latest commits 2014-02-06 18:19:24 +01:00
Peter Rajnoha
73f30ed6a4 dmeventd: check pidfile for exit instead of polling via protocol
Since we use unlink + _exit now on dmeventd DIE message, we can
check the pidfile existence to see whether the dmeventd has finished.
2014-02-06 17:53:03 +01:00
Peter Rajnoha
90286fa0e9 dmeventd: use _exit(0) instead of raise(9) on dmeventd DIE message
Just a cleaner way to die.
2014-02-06 17:41:13 +01:00
Peter Rajnoha
fbeb08f320 dmeventd: add DM_EVENT_GET_PARAMETERS request to dmeventd protocol
The DM_EVENT_GET_PARAMETERS requests the parameters under which
the running dmeventd is run and the it sends them to caller.

The parameters sent:
  - the pid of the running dmeventd
  - foreground state
  - exec_method (currently either "direct" or "systemd")

The exact message sent back:
  pid=<pid> daemon=<no/yes> exec_method=<direct/systemd>
2014-02-06 17:41:12 +01:00
Peter Rajnoha
8a8abc5ed9 dmeventd: fix dmeventd -R to work properly with systemd
Trying to restart dmeventd as a reload action is causing problems
under systemd environment. The systemd loses track of new dmeventd
this way. See also https://bugzilla.redhat.com/show_bug.cgi?id=1060134
for more info.

We need to call dmeventd -R directly instead of "systemctl reload dm-event.service"
that was used before (the reload is aimed at configuration reload anyway,
not stateful restart of the daemon - we did this before just because
there's no ExecRestart in systemd and there's only ExecStart and
ExecStop with which we'd lose the state).

Also, use ExecStart="dmeventd -f" to run dmeventd in foreground
(and let's rely on systemd to daemonize it) and change the
service type from "forking" to "simple".
2014-02-06 17:15:19 +01:00
Jonathan Brassow
36f9fadcb4 cache[pool]: Populate existing report fields with cache data
For the report fields that already exist that are relevent to cache
and cache pool LVs (like 'origin', 'metadata_lv', etc), populate
them.
2014-02-05 09:44:37 -06:00
Jonathan Brassow
96626f64fa cache: Code to allow the create/remove of cache LVs
This patch allows users to create cache LVs with 'lvcreate'.  An origin
or a cache pool LV must be created first.  Then, while supplying the
origin or cache pool to the lvcreate command, the cache can be created.

Ex1:
Here the cache pool is created first, followed by the origin which will
be cached.
~> lvcreate --type cache_pool -L 500M -n cachepool vg /dev/small_n_fast
~> lvcreate --type cache -L 1G -n lv vg/cachepool /dev/large_n_slow

Ex2:
Here the origin is created first, followed by the cache pool - allowing
a cache LV to be created covering the origin.
~> lvcreate -L 1G -n lv vg /dev/large_n_slow
~> lvcreate --type cache -L 500M -n cachepool vg/lv /dev/small_n_fast

The code determines which type of LV was supplied (cache pool or origin)
by checking its type.  It ensures the right argument was given by ensuring
that the origin is larger than the cache pool.

If the user wants to remove just the cache for an LV.  They specify
the LV's associated cache pool when removing:
~> lvremove vg/cachepool

If the user wishes to remove the origin, but leave the cachepool to be
used for another LV, they specify the cache LV.
~> lvremove vg/lv

In order to remove it all, specify both LVs.

This patch also includes tests to create and remove cache pools and
cache LVs.
2014-02-04 16:50:16 -06:00
Jonathan Brassow
97be8b3482 cache: Code changes to allow creation of cache pools
This patch allows the creation and removal of cache pools.  Users are not
yet able to create cache LVs.  They are only able to define the space used
for the cache and its characteristics (chunk_size and cache mode ATM) by
creating the cache pool.
2014-02-04 11:57:08 -06:00
Jonathan Brassow
013cf27bff cache pool: Add 'update_cache_pool_params'
Similar function to 'update_thin_pool_params', but for cache.  Performs
the adjustements for chunk_size, metdata device size, etc.
2014-02-04 11:50:27 -06:00
Jonathan Brassow
8ddc7f641c misc: disambiguate 'update_pool_params'
s/update_pool_params/update_thin_pool_params/ to disambiguate it from
a future 'update_cache_pool_params'.
2014-02-04 09:58:35 -06:00