1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00
Commit Graph

6276 Commits

Author SHA1 Message Date
Zdenek Kabelac
f7a26917f2 Drop unimplemented 2012-01-19 16:22:42 +00:00
Zdenek Kabelac
946166795e Drop unused variable 2012-01-19 15:59:51 +00:00
Zdenek Kabelac
62fa6a8289 Thin indent update 2012-01-19 15:42:18 +00:00
Zdenek Kabelac
8aa21348d1 Thin disable snapshot creation when pool is over the threshold.
Since snapshot needs to suspend origin - it might lead to pool userspace
deadlock (as the pool will wait for new space in case it would be overfilled,
but dmeventd would not be able to resize it, as the lvcreate operation would
have kept the VG lock.)
To minimize the risk of such scenario - we prevent to create new snapshot
in case we are over the threshold - but beware, there is still small timewindow,
so keep threshold at some reasonable level!
2012-01-19 15:39:41 +00:00
Zdenek Kabelac
8d3933945a Thin add new display field for lvs
New field Data% is able to display info about
thin_pool, thin, snapshot and has generic meaning here.

Simple Time/Host field are here to display host and time creation.
2012-01-19 15:34:32 +00:00
Zdenek Kabelac
06849a0d6a Add support to keep info about creation time and host for each LV
Basic support to keep info when the LV was created.
Host and time is stored into LV mda section.

FIXME: Current version doesn't support configurable string via lvm.conf
and used fixed version strftime "%Y-%m-%d %T %z".
2012-01-19 15:31:45 +00:00
Zdenek Kabelac
491d106031 Thin add function to read thin volume percent
This value returns percentage of 'mapped' size compared with total LV size.
(Without passed seg pointer it return highest mapped size - but it's
not used yet.)
2012-01-19 15:27:54 +00:00
Zdenek Kabelac
9fae965546 Thin updated support for thin pool percent
Support to check also for metadata percent
(By checking whether seg pointer is set)
2012-01-19 15:25:37 +00:00
Zdenek Kabelac
57979a273c Thin rename seg var pool_metadata_lv to metadata_lv
Better fits the code.
2012-01-19 15:23:50 +00:00
Zdenek Kabelac
4174dad301 Thin handle empty thin volume case
Report both values as 0 in case the volume is unused.
2012-01-19 15:22:32 +00:00
Zdenek Kabelac
a1224b2da8 Thin use consistentely metadata
Do not shortcut to 'meta' and stay with 'metadata'
Also matches kernel doc for dm API then.
2012-01-19 15:21:23 +00:00
Zdenek Kabelac
440a4d4c76 Thin rename local static
Use '_' for local const char.
2012-01-19 15:19:18 +00:00
Zdenek Kabelac
3a55acee5b Rename internal macro to match signess
Since _read_int64 called dm_config_get_uint64, rename it to
less confusing _read_uint64.
2012-01-19 15:17:46 +00:00
Zdenek Kabelac
dd0fc6d3a8 Update for gcc old-style 2012-01-19 15:16:39 +00:00
Alasdair Kergon
5c9bebee8a Add dmsetup 'wipe_table' to replace table with one that uses error target. 2012-01-18 18:52:02 +00:00
Peter Rajnoha
de0822a2bf Move dm_task_set_newname from libdm-iface.c to libdm-common.c 2012-01-17 14:36:58 +00:00
Petr Rockai
693e6e76a9 Beef up the lvmetad code with more functionality and a bunch of bugfixes. There
used to be a few mis-ordered memory accesses (release and access in the next
block). Fix that set_flag could have sometimes corrupted the flags being
modified.

A few issues with metadata tracking are sorted out as well now, and there are
only a few problems remaining before we can integrate lvmetad, mostly on the
client side:

- metadata areas need to be tracked in lvmetad (most likely to be addressed
  through an extension of metadata, meaning no special support in lvmetad would
  be needed)
- non-udev scanning code needs to be taught about telling lvmetad about device
  disappearance (pvscan most importantly)
- this last item also needs to mesh with metadata inconsistencies and
  suddenly-incomplete volume groups (aux disable_dev in tests); udev-based
  scanning should address this separately and more elegantly
2012-01-16 08:25:32 +00:00
Petr Rockai
5463a05a32 Fix a boundary condition in read_buffer in daemon-shared.c. 2012-01-16 05:09:16 +00:00
Petr Rockai
e3b4fe6ed2 Fix prototypes for daemon_send_simple (const char). 2012-01-15 15:16:50 +00:00
Petr Rockai
921de583f4 Unfortunately, blank lines are sometimes produced by config serializer, and
this interferes with their role as message separator in the lvmetad
protocol. Switch to using "##" on an otherwise blank line as a separator.
2012-01-15 11:17:16 +00:00
Petr Rockai
e31a3a6da6 Fix a couple of resource leaks in daemon-common server code -- filehandles and
unjoined threads were leaked for each connection.
2012-01-15 10:33:41 +00:00
Alasdair Kergon
55bdb63f34 Make error message hit when preallocated memlock memory exceeded clearer. 2012-01-12 18:29:07 +00:00
Alasdair Kergon
75fe459800 Show read-only activation in display tools. 2012-01-12 16:58:43 +00:00
Peter Rajnoha
5bafde0b6f Missing const.
"warning: assignment discards 'const' qualifier..."
2012-01-12 09:08:55 +00:00
Alasdair Kergon
57fafd762f Add activation/read_only_volume_list to override LV permission in metadata. 2012-01-12 02:32:09 +00:00
Alasdair Kergon
642da16c33 Add activation/read_only_volume_list to override LV permission in metadata. 2012-01-12 01:51:56 +00:00
Alasdair Kergon
661f154b66 Give priority to emcpower devices with duplicate PVIDs. 2012-01-11 20:38:42 +00:00
Peter Rajnoha
8227bf45d1 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
ad96b1b460 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
ee1e9fcd22 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
7da3845926 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
8a3960d217 Minor oldstyle warning update 2012-01-09 12:29:15 +00:00
Zdenek Kabelac
99a1830b46 Improve readahead in dmsetup man page 2012-01-09 12:28:47 +00:00
Zdenek Kabelac
6cf41f5503 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
51c8cf97af 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
46a75dedb4 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
f4cb382829 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
c06fdae782 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
47bc4f5191 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
52eae5fec2 Thin man page update 2011-12-21 13:58:38 +00:00
Zdenek Kabelac
d3e0fc4374 Thin update test case
Use thin-pool instead of thin_pool type.
2011-12-21 13:45:42 +00:00
Zdenek Kabelac
e906e9a160 Exported functions from thin plugin 2011-12-21 13:42:07 +00:00
Zdenek Kabelac
9e1ccf81c7 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
88f8cbbb2e 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
235028bf0f 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
93bb35fd2b 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
d3923ece3d Thin automatic policy based extension 2011-12-21 13:10:52 +00:00
Zdenek Kabelac
58044875a8 Thin add lv_thin_pool_percent 2011-12-21 13:10:05 +00:00
Zdenek Kabelac
88bf72d388 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
59bcd5a1cf 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