1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 10:25:13 +03:00
Commit Graph

6355 Commits

Author SHA1 Message Date
Alasdair Kergon
a7d2f7795a Make error message hit when preallocated memlock memory exceeded clearer. 2012-01-12 18:29:07 +00:00
Alasdair Kergon
8f95d94b4f Show read-only activation in display tools. 2012-01-12 16:58:43 +00:00
Peter Rajnoha
5d5c80ace7 Missing const.
"warning: assignment discards 'const' qualifier..."
2012-01-12 09:08:55 +00:00
Alasdair Kergon
b5ca3d1ed0 Add activation/read_only_volume_list to override LV permission in metadata. 2012-01-12 02:32:09 +00:00
Alasdair Kergon
a18dcfb533 Add activation/read_only_volume_list to override LV permission in metadata. 2012-01-12 01:51:56 +00:00
Alasdair Kergon
1e482f7ca6 Give priority to emcpower devices with duplicate PVIDs. 2012-01-11 20:38:42 +00:00
Peter Rajnoha
e33fd978a8 Support different device name types on output of dmsetup deps, ls and info -c command.
Add 'blkdevname' and 'blkdevs_used' field to dmsetup info -c -o.
Add 'blkdevname' option to dmsetup ls --tree to see block device names.
Add '-o options' to dmsetup deps and ls to select device name type on output.
2012-01-11 12:46:19 +00:00
Peter Rajnoha
17c3e42b21 Add dm_device_get_name to get map name or block device name for given devno.
This is accomplished by reading associated sysfs information. For a dm device,
this is /sys/dev/block/major:minor/dm/name (supported in kernel version >= 2.6.29,
for older kernels, the behaviour is the same as for non-dm devices).

For a non-dm device, this is a readlink on /sys/dev/block/major:minor, e.g.
  /sys/dev/block/253:0 --> ../../devices/virtual/block/dm-0.
The last component of the path is a proper kernel name (block device name).

One can request to read only kernel names by setting the 'prefer_kernel_name'
argument if needed.
2012-01-11 12:34:44 +00:00
Alasdair Kergon
2e5ff5d11c Add dm_uuid_prefix/dm_set_uuid_prefix for non-lvm users to override hard-coded
LVM- prefix.

Try harder not to leave stray empty devices around (locally or remotely) when
reverting changes after failures while there are inactive tables.
2012-01-10 02:03:31 +00:00
Zdenek Kabelac
7afa7b079c Check for error code in _adjust_policy_params
If error is detected in _adjust_policy_params, break further command processing.
2012-01-09 12:31:52 +00:00
Zdenek Kabelac
f9fb138bdd Minor oldstyle warning update 2012-01-09 12:29:15 +00:00
Zdenek Kabelac
e49622ef17 Improve readahead in dmsetup man page 2012-01-09 12:28:47 +00:00
Zdenek Kabelac
044abcf91b Use sysfs to set/get of read-ahead
If we know major:minor number of device (which is known after resume) we will
try to use  sysfs to set/get read ahead parameters of device.
This avoid potential problem of blocking commands like 'dmsetup info' awaiting
for device being usable for open/close - i.e. overfilled thin pool may block
such command.
2012-01-09 12:26:14 +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
1aae627433 Use new dmeventd_lvm2_command function in dmeventd plugins.
For snapshot, prepare whole command in front into private buffer.
Add also some missing '\n' for syslog messages.
For raid and mirror only convert creation of command line string.
This should avoid any unbound growth of mempool for dm_split_names.
2011-12-22 16:37:01 +00:00
Zdenek Kabelac
ed1289140e Thin use helper function
Fix some minor outstading issue from thin plugin introduction -
Call dmeventd_lvm2_exit() in failpath for registration.
Add some missing '\n' in syslog messages.
2011-12-22 15:57:29 +00:00
Zdenek Kabelac
8527b92738 Add helper function dmeventd_lvm2_command().
Since this code is in all plugins - create a common helper function.
2011-12-22 15:55:21 +00:00
Zdenek Kabelac
59e1bb62de Updated documentation for dmeventd.
Update man page style.
Mention raid and thin plugins.
Update help text printed by command to match man page.
2011-12-22 15:50:38 +00:00
Zdenek Kabelac
301e821d3b Thin man page update 2011-12-21 13:58:38 +00:00
Zdenek Kabelac
61d8cb80e4 Thin update test case
Use thin-pool instead of thin_pool type.
2011-12-21 13:45:42 +00:00
Zdenek Kabelac
351bf47486 Exported functions from thin plugin 2011-12-21 13:42:07 +00:00
Zdenek Kabelac
5339307ca7 Drop extra stat before open of device
Since the !(dev->flags & DEV_REGULAR) code path just called
dev_name_confirmed() which has just called 'stat()' inside,
remove duplicate second stat() call here.
2011-12-21 13:24:24 +00:00
Zdenek Kabelac
538d5e81a7 Do not lstat common path prefix
When both path have identical prefix i.e. /dev/disk/by-id
skip  2 x lstat() for /dev  /dev/disk /dev/disk/by-id
and directly lstat() only different part of the path.

Reduces amount of lstat calls on system with lots of devices.
2011-12-21 13:21:09 +00:00
Zdenek Kabelac
5146908366 Add common initialization code for struct device
Avoid duplicate code and add _dev_init() where all common
member values are initialized.
2011-12-21 13:17:54 +00:00
Zdenek Kabelac
b062ee2826 Always zalloc device structure
Since there is zalloc behind the macro, put 'z' into the name.
Make the 'use_malloc' code path also using zalloc() call,
so it also give zeroed area.
2011-12-21 13:14:54 +00:00
Zdenek Kabelac
0e0f706f2e Thin automatic policy based extension 2011-12-21 13:10:52 +00:00
Zdenek Kabelac
34507894e9 Thin add lv_thin_pool_percent 2011-12-21 13:10:05 +00:00
Zdenek Kabelac
c0fcaacb8d Thin add dev_manager_thin_pool_percent
dev manager function to read percent info from thin pool.
2011-12-21 13:09:33 +00:00
Zdenek Kabelac
2bc1d7598e Thin add dmeventd support
This is basic version with still few unresolved issue mainly in case,
when the pool resize is failing.
2011-12-21 13:08:11 +00:00
Zdenek Kabelac
169470b621 Fix missing thread list manipulation
For manipulation with thread list to avoid race with timeout thread,
take also _timeout_mutex.
2011-12-21 13:03:06 +00:00
Zdenek Kabelac
d3b4a0f322 Check lv pointer for NULL before derefence. 2011-12-21 12:59:22 +00:00
Zdenek Kabelac
0190769d4f Thin remove unused code 2011-12-21 12:56:45 +00:00
Zdenek Kabelac
0d59090eaf Thin move layer suffix into local static const 2011-12-21 12:55:22 +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
077c4d1a35 Add Thin API for parsing thin status
Add dm_get_status_thin_pool and dm_get_status_thin functions to
parse 'params' argument which is received via dm_get_next_target.

Returns filed structure allocated from given mempool.
2011-12-21 12:52:38 +00:00
Zdenek Kabelac
61158adbcf Allow empty strings for description and creation_host config fields 2011-12-21 12:49:00 +00:00
Zdenek Kabelac
99a150fc26 Add dm_config_find_str_allow_empty
Support empty string values.
2011-12-21 12:47:44 +00:00
Alasdair Kergon
66e5b7f53c Reinstate support for format1 snapshots, but issue deprecated warning.
I anticipate removing support for snapshots with lvm1-formatted metadata in a
future release.
2011-12-20 00:02:18 +00:00
Petr Rockai
90b7423846 Add a unit test for config cascade (overlay). Needs expanding though. 2011-12-18 23:56:36 +00:00
Petr Rockai
f401655ee8 Fix up lvmetad for the minor API change in dm_config_create. 2011-12-18 22:31:10 +00:00
Petr Rockai
845b1df617 Make a cleaner split between config tree and config file functionality. Move
the latter out of libdm.
2011-12-18 21:56:03 +00:00
Peter Rajnoha
32e53e506d Use also normalized output for vgchange command in lvm2-monitor init script. 2011-12-16 11:42:56 +00:00
Zdenek Kabelac
c6958856f8 Cleanup test compile warning
Add some declaration and cast to cleanup gcc warnings.
Add missing dm_config_destroy() to cleanup pool leak report.
2011-12-13 12:08:42 +00:00
Petr Rockai
4e73e7ac16 Fix a compiler warning. 2011-12-12 00:08:23 +00:00
Petr Rockai
a8215f3774 Use a more canonic regex escaping in the default lvm.conf file for testing. 2011-12-12 00:01:12 +00:00
Petr Rockai
11e520256b Move dm_config_write out of libdm, back to lib/config, as config_write. 2011-12-11 23:18:20 +00:00
Petr Rockai
509278c7d2 Add a shell test for config parsing and merging (lvm dumpconfig). 2011-12-11 23:14:37 +00:00
Petr Rockai
426fc74255 Autoreconf. 2011-12-11 17:24:37 +00:00
Petr Rockai
06c51c80d7 Add a unit test for dm_config_clone_node. 2011-12-11 15:45:14 +00:00
Petr Rockai
3324f8f4b8 Start a rudimentary unit test for the dm_config_* interface. 2011-12-11 15:19:41 +00:00