]> sourceware.org Git - lvm2.git/log
lvm2.git
11 years agoconfig: add profile arg to find_config_tree_int64
Peter Rajnoha [Tue, 25 Jun 2013 10:31:24 +0000 (12:31 +0200)]
config: add profile arg to find_config_tree_int64

11 years agoconfig: add profile arg to find_config_tree_int
Peter Rajnoha [Tue, 25 Jun 2013 10:30:34 +0000 (12:30 +0200)]
config: add profile arg to find_config_tree_int

11 years agoconfig: add profile arg to find_config_tree_str_allow_empty
Peter Rajnoha [Tue, 25 Jun 2013 10:30:08 +0000 (12:30 +0200)]
config: add profile arg to find_config_tree_str_allow_empty

11 years agoconfig: add profile arg to find_config_tree_str
Peter Rajnoha [Tue, 25 Jun 2013 10:29:54 +0000 (12:29 +0200)]
config: add profile arg to find_config_tree_str

11 years agoconfig: add profile arg to find_config_tree_node
Peter Rajnoha [Tue, 25 Jun 2013 10:29:33 +0000 (12:29 +0200)]
config: add profile arg to find_config_tree_node

11 years agometadata: read VG/LV profile name from metadata if it exists and load it
Peter Rajnoha [Tue, 25 Jun 2013 10:28:36 +0000 (12:28 +0200)]
metadata: read VG/LV profile name from metadata if it exists and load it

This is per VG/LV profile loading on demand. The profile itself is saved
in struct volume_group/logical_volume as "profile" field so we can
reference it whenever needed.

11 years agoconfig: add override_config_tree_from_profile fn to add the profile to a configuratio...
Peter Rajnoha [Tue, 25 Jun 2013 10:27:37 +0000 (12:27 +0200)]
config: add override_config_tree_from_profile fn to add the profile to a configuration cascade

When placing the profile in a configuration cascade, this sequence is
used exactly:

CONFIG_STRING -> CONFIG_PROFILE -> CONFIG_FILE/MERGED_FILES

So if the profile is used, it overloads the lvm.conf (and any
existing tag configs). However, if "--config" is used to define
a custom configuration on command line, this overloads even the
profile config!

11 years agoconfig: add support for loading profiles
Peter Rajnoha [Tue, 25 Jun 2013 10:27:04 +0000 (12:27 +0200)]
config: add support for loading profiles

This patch adds --profile arg to lvm cmds and adds config/profile_dir
configuration setting to select the directory where profiles are stored
By default it's /etc/lvm/profile.

The profiles are added by using new "add_profile" fn and then loaded
using the "load_profile" fn. All profiles are stored in a cmd context
within the new "struct profile_params":

struct profile_params {
  const char *dir;
  struct profile *global_profile;
  struct dm_list profiles_to_load;
  struct dm_list profiles;
};

...where "dir" is the directory with profiles, "global_profile" is
the profile that is set globally via the --profile arg (IOW, not
set per VG/LV basis based on metadata record) and the "profiles"
is the list with loaded profiles.

11 years agoconfigure: add configure --with-default-profile-subdir
Peter Rajnoha [Tue, 25 Jun 2013 10:26:40 +0000 (12:26 +0200)]
configure: add configure --with-default-profile-subdir

Configuration profiles are selected configuration items that can
be loaded dynamically on demand and overlayed over existing
configuration on demand (either on cmd line by selecting the profile
name to be used globally or retrieved from metadata and used per
VG/LV basis only).

The default directory where profiles are stored is configurable
at compile time with --with-default-profile-subdir.

11 years agoconfig: add config_source_t type to identify configuration source
Peter Rajnoha [Tue, 25 Jun 2013 10:25:43 +0000 (12:25 +0200)]
config: add config_source_t type to identify configuration source

A helper type that helps with identification of the configuration source
which makes handling the configuration cascade a bit easier, mainly
removing and adding configuration trees to cascade dynamically.

Currently, the possible types are:

  CONFIG_UNDEFINED - configuration is not defined yet (not initialized)
  CONFIG_FILE - one file configuration
  CONFIG_MERGED_FILES - configuration that is a result of merging more files into one
  CONFIG_STRING - configuration string typed on cmd line directly
  CONFIG_PROFILE - profile configuration (the new type of configuration, patches will follow...)

Also, generalize existing "remove_overridden_config_tree" to work with
configuration type identification in a cascade. Before, it was just
the CONFIG_STRING we used. Now, we need some more to add in a
cascade (like the CONFIG_PROFILE). So, we have:

  struct dm_config_tree *remove_config_tree_by_source(struct cmd_context *cmd, config_source_t source);
  config_source_t config_get_source_type(struct dm_config_tree *cft);

... for removing the tree by its source type from the cascade and
simply getting the source type.

11 years agorefactor: factor out common part of the code to open and read config files
Peter Rajnoha [Tue, 25 Jun 2013 10:25:23 +0000 (12:25 +0200)]
refactor: factor out common part of the code to open and read config files

11 years agoarchive: add missing bit set
Zdenek Kabelac [Tue, 2 Jul 2013 09:07:15 +0000 (11:07 +0200)]
archive: add missing bit set

In the last update not all code paths have set the archived flag.
If we run in test mode or without archiving enabled - set the bit
as well - so test whether archiving has been called succesfully
will be ok. (in relase fix).

11 years agocleanup: swap initial assignment
Zdenek Kabelac [Sun, 30 Jun 2013 19:40:56 +0000 (21:40 +0200)]
cleanup: swap initial assignment

Easier to read code.

11 years agocleanup: stack usage
Zdenek Kabelac [Mon, 1 Jul 2013 09:27:11 +0000 (11:27 +0200)]
cleanup: stack usage

Shortening code with macros return_0, return_NULL.
Add some missing stack prints in error paths.

11 years agocleanup: introduce return_ECMD_FAILED macro
Zdenek Kabelac [Mon, 1 Jul 2013 09:27:22 +0000 (11:27 +0200)]
cleanup: introduce return_ECMD_FAILED macro

Use shortening macro for common code sequence
stack;
return ECMD_FAILED;

11 years agovg/lvchange: drop local archived handling
Zdenek Kabelac [Sun, 30 Jun 2013 16:03:34 +0000 (18:03 +0200)]
vg/lvchange: drop local archived handling

Drop code handling archived flag now handled implicitely.

11 years agoarchiver: do not archive vg more then once
Zdenek Kabelac [Sun, 30 Jun 2013 16:01:19 +0000 (18:01 +0200)]
archiver: do not archive vg more then once

Do not keep multiple archives for the executed command.
Reuse the ALLOCATABLE_PV from pv status for
ARCHIVED_VG vg status. Mark VG with the bit with the
first archivation.

11 years agocleanup: move bit flags in order
Zdenek Kabelac [Sun, 30 Jun 2013 15:06:09 +0000 (17:06 +0200)]
cleanup: move bit flags in order

Preseve the sequence of bits.

11 years agocleanup: simplify code around flock
Zdenek Kabelac [Sat, 29 Jun 2013 21:10:33 +0000 (23:10 +0200)]
cleanup: simplify code around flock

11 years agocleanup: more dmeventd code cleanup
Zdenek Kabelac [Sun, 30 Jun 2013 14:04:14 +0000 (16:04 +0200)]
cleanup: more dmeventd code cleanup

11 years agodmeventd: move code from signal handler
Zdenek Kabelac [Sun, 30 Jun 2013 13:53:42 +0000 (15:53 +0200)]
dmeventd: move code from signal handler

Instead of calling syslog() from signal event handler,
run all logging code in the main loop.

Also it needs to take the lock and check for list
only when really needed.

11 years agometadata: log_debug only when BA found in metadata
Peter Rajnoha [Thu, 27 Jun 2013 14:03:35 +0000 (16:03 +0200)]
metadata: log_debug only when BA found in metadata

...not the other way round as it was before. This way it makes
more sense as BA use is exceptional and it's useless to
contaminate the log with messages about BA not being found
in metadata.

11 years agocleanup: clear outdated comment (TODO already done)
Peter Rajnoha [Thu, 27 Jun 2013 13:26:39 +0000 (15:26 +0200)]
cleanup: clear outdated comment (TODO already done)

11 years agodmeventd: fix cleanup commit
Zdenek Kabelac [Tue, 25 Jun 2013 21:05:06 +0000 (23:05 +0200)]
dmeventd: fix cleanup commit

Fixing wrong rebase of cleanup commit.
Put back call to outth.

11 years agodebug: add pointer to -DDEBUG_POOL compilation
Zdenek Kabelac [Thu, 18 Feb 2010 15:38:32 +0000 (16:38 +0100)]
debug: add pointer to -DDEBUG_POOL compilation

Show 'at' pointer address with pool name.
It's useful for debugging to be able to locate pointer address in the
debug trace log. It's only available when compiled with extra debug
compilation flag DEBUG_POOL in make.tmpl.

11 years agothin: check for creation of pool
Zdenek Kabelac [Mon, 24 Jun 2013 18:54:05 +0000 (20:54 +0200)]
thin: check for creation of pool

11 years agocleanup: add dot to lvchange message
Zdenek Kabelac [Tue, 25 Jun 2013 11:43:35 +0000 (13:43 +0200)]
cleanup: add dot to lvchange message

11 years agocleanup: use "" around type in error message
Zdenek Kabelac [Mon, 24 Jun 2013 10:00:48 +0000 (12:00 +0200)]
cleanup: use "" around type in error message

A bit more cleaner error message for wrong discards paramater.

11 years agocleanup: move mirror check code closer
Zdenek Kabelac [Mon, 24 Jun 2013 09:55:18 +0000 (11:55 +0200)]
cleanup: move mirror check code closer

Group a bit more code related to mirrors.

11 years agocleanup: code swap
Zdenek Kabelac [Mon, 24 Jun 2013 09:48:08 +0000 (11:48 +0200)]
cleanup: code swap

Use easier to read positive query and indent line.

11 years agocleanup: use log_print instead of log_error
Zdenek Kabelac [Thu, 20 Jun 2013 12:08:25 +0000 (14:08 +0200)]
cleanup: use log_print instead of log_error

Since reduce the message has informational character and doesn't lead
to exit of the command - reduce the log level to info print as we
use for other similar types.

Reindent next print message.

11 years agocleanup: reformat code of dmeventd
Zdenek Kabelac [Thu, 21 Jun 2012 19:20:01 +0000 (21:20 +0200)]
cleanup: reformat code of dmeventd

11 years agocleanup: Remove message used for development
Jonathan Brassow [Mon, 24 Jun 2013 11:16:39 +0000 (06:16 -0500)]
cleanup:  Remove message used for development

Failed to clean out all messages used during development.

11 years agodev-type: dev_get_primary_dev: fix ret value if dev is a partition and we used sysfs
Peter Rajnoha [Sun, 23 Jun 2013 09:14:34 +0000 (11:14 +0200)]
dev-type: dev_get_primary_dev: fix ret value if dev is a partition and we used sysfs

11 years agoTEST: Test RAID syncaction, writemostly, & refresh under snapshots
Jonathan Brassow [Thu, 20 Jun 2013 16:48:15 +0000 (11:48 -0500)]
TEST: Test RAID syncaction, writemostly, & refresh under snapshots

Test the different RAID lvchange scenarios under snapshot as well.

This patch also updates calculations for where to write to an
underlying PV when testing various syncactions.

11 years agoClean-up: WHATS_NEW
Jonathan Brassow [Thu, 20 Jun 2013 00:55:34 +0000 (19:55 -0500)]
Clean-up: WHATS_NEW

Choosing between two entries and forgot to remove one.

11 years agoRAID/MIRROR: Honor mirror_segtype_default when upconverting linear LVs
Jonathan Brassow [Wed, 19 Jun 2013 22:50:10 +0000 (17:50 -0500)]
RAID/MIRROR: Honor mirror_segtype_default when upconverting linear LVs

If the user would upconvert a linear LV to a mirror without specifying
the segment type ("--type mirror" vs "--type raid1"), the "mirror"
segment type would be chosen without consulting the 'default_mirror_segtype'
setting in lvm.conf.  This is now used as the basis for determining
which should be used if left unspecified.

11 years agocleanup: use parsed yes_no_arg
Zdenek Kabelac [Mon, 17 Jun 2013 17:55:02 +0000 (19:55 +0200)]
cleanup: use parsed yes_no_arg

Do not parse yes_no_arg inside tools code and use already
available result as uint.

11 years agocleanup: return lv_is_ as 1 or 0
Zdenek Kabelac [Mon, 17 Jun 2013 17:46:22 +0000 (19:46 +0200)]
cleanup: return lv_is_ as 1 or 0

Do not return 64bit values - return just plain int 0 or 1

11 years agocleanup: easier to read loop code
Zdenek Kabelac [Tue, 18 Jun 2013 09:59:22 +0000 (11:59 +0200)]
cleanup: easier to read loop code

buffer_write now accepts const pointer
Simplify loops and drop goto when not needed.

11 years agolvmetad: fix compare function
Zdenek Kabelac [Tue, 18 Jun 2013 19:58:13 +0000 (21:58 +0200)]
lvmetad: fix compare function

Check for enough space in preallocated buffer.
Fixes problem, when lvm code started to suddenly allocate
too big memory chunks.

TODO: lvmetad protocol should announce needed size ahead,
so if metadata have 1MB we are not reallocating memory...

11 years agolvmetad: use dm_ malloc wrappers
Zdenek Kabelac [Tue, 18 Jun 2013 19:57:14 +0000 (21:57 +0200)]
lvmetad: use dm_ malloc wrappers

Use matching dm_ functions for internally used buffers.

11 years agovgcfgrestore: fix crash on restore of wrong vgname
Zdenek Kabelac [Tue, 18 Jun 2013 19:50:29 +0000 (21:50 +0200)]
vgcfgrestore: fix crash on restore of wrong vgname

When vgname has not existed in metadata, it has crashed on double free
in format_instance destroy() -  since VG was created, used FID and was
released - which also released FID, so further use was accessing bad
memory.

Fix it for this code path before release_vg() so FID will exists
when _vg_read_file_name() returns NULL.

11 years agoRAID: Remove optimization using static vars in lv_raid_dev_health
Jonathan Brassow [Mon, 17 Jun 2013 18:03:15 +0000 (13:03 -0500)]
RAID: Remove optimization using static vars in lv_raid_dev_health

Revert commit 37ffe6a.  If static variables are to be used then we
will put them elsewhere and limit the optimization to reporting
code, rather that have it be used in the general case.

11 years agoRAID: s/int/uint32_t for dev_count in dm_status_raid struct
Jonathan Brassow [Mon, 17 Jun 2013 17:58:38 +0000 (12:58 -0500)]
RAID:  s/int/uint32_t for dev_count in dm_status_raid struct

Device count is never negative.  Change 'dev_count' to be
uint32_t instead of int.

11 years agoTEST: Fix 'dd' overrunning device size and causing test failure
Jonathan Brassow [Mon, 17 Jun 2013 17:38:09 +0000 (12:38 -0500)]
TEST: Fix 'dd' overrunning device size and causing test failure

Assumed size of 4M was too large and the test was failing because
'dd' was failing to perform its write.

Calculate the size we need to write with 'dd' instead, so we
don't overrun the device.

11 years agodev-type: add/fix references for dev_types in non-linux case
Peter Rajnoha [Mon, 17 Jun 2013 13:17:15 +0000 (15:17 +0200)]
dev-type: add/fix references for dev_types in non-linux case

11 years agosnapshot: fix max size limit check for COW device
Zdenek Kabelac [Sun, 16 Jun 2013 19:32:11 +0000 (21:32 +0200)]
snapshot: fix max size limit check for COW device

Use proper max size as a multiple of extent size.
And use 64bit arithmentic for validation of minsize.
(in release fix).

11 years agocleanup: use struct assign
Zdenek Kabelac [Sun, 16 Jun 2013 19:07:39 +0000 (21:07 +0200)]
cleanup: use struct assign

Simplier code with struct assign.
Drop unneeded zeroing of zallocated memory.

11 years agoclean: remove unneeded assign
Zdenek Kabelac [Sun, 16 Jun 2013 19:05:30 +0000 (21:05 +0200)]
clean: remove unneeded assign

Since init_unknown_segtype returns zalloced memory,
NULL assign is not needed.

11 years agotests: more test run in cluster mode
Zdenek Kabelac [Sat, 15 Jun 2013 09:21:03 +0000 (11:21 +0200)]
tests: more test run in cluster mode

aux updates:

prepare_vg now created clustered VG for cluster tests.

since dm-raid doesn't work in cluster, skip the cluster
test when someone checks for dm-raid target until fixed.

11 years agocleanup: access pool segs with check
Zdenek Kabelac [Fri, 14 Jun 2013 20:02:12 +0000 (22:02 +0200)]
cleanup: access pool segs with check

Add some minor checks after first_seg(lv).
Use direct check for thin pool segment.
Drop some unneeded {}

11 years agocleanup: use simplier structure initialization
Zdenek Kabelac [Fri, 14 Jun 2013 20:00:44 +0000 (22:00 +0200)]
cleanup: use simplier structure initialization

And also use static struct for _out_spec.

11 years agocleanup: use unrelated temporary variables
Zdenek Kabelac [Fri, 14 Jun 2013 19:49:12 +0000 (21:49 +0200)]
cleanup: use unrelated temporary variables

use of tmp_rq2 is unrelated to tmp_rq - so use separate
variable.

11 years agocleanup: move string in the use-place
Zdenek Kabelac [Fri, 14 Jun 2013 19:48:33 +0000 (21:48 +0200)]
cleanup: move string in the use-place

11 years agocleanup: drop unused headers
Zdenek Kabelac [Fri, 14 Jun 2013 07:52:02 +0000 (09:52 +0200)]
cleanup: drop unused headers

Drop heades which do not provide any used symbols.

11 years agocleanup: add extra internal error
Zdenek Kabelac [Fri, 14 Jun 2013 07:51:09 +0000 (09:51 +0200)]
cleanup: add extra internal error

Ensure the target line will work only with segment with pool.

11 years agoconfig: skip close of stdin
Zdenek Kabelac [Fri, 14 Jun 2013 21:18:29 +0000 (23:18 +0200)]
config: skip close of stdin

If the used stream has been stdout, do not close it.

11 years agomirror: add missing error message
Zdenek Kabelac [Sat, 15 Jun 2013 16:43:36 +0000 (18:43 +0200)]
mirror: add missing error message

When a user has not proceeded with conversion,
print the error message why the command has failed.

11 years agolvmetad: add some message for error path
Zdenek Kabelac [Fri, 14 Jun 2013 21:17:28 +0000 (23:17 +0200)]
lvmetad: add some message for error path

Do not leave replay uninitialized for internal error.

11 years agotext: miscellaneous comments & message tweaks
Alasdair G Kergon [Sat, 15 Jun 2013 00:28:54 +0000 (01:28 +0100)]
text: miscellaneous comments & message tweaks

11 years agoreport: revert lvs origin_size sort order change
Alasdair G Kergon [Sat, 15 Jun 2013 00:24:16 +0000 (01:24 +0100)]
report: revert lvs origin_size sort order change

Reinstate the previous sort order for origin_size, so that LVs with
an empty origin_size continue to appear at the start of the list
not the end.

Ref. 9d445f371c7658969d6580748233dc33c3ba0453

11 years agoconf: refine lvm.conf documentation for autoactivation feature even more
Peter Rajnoha [Fri, 14 Jun 2013 10:35:06 +0000 (12:35 +0200)]
conf: refine lvm.conf documentation for autoactivation feature even more

11 years agotypo: lvm.conf: auto_activation_list -> auto_activation_volume_list
Peter Rajnoha [Fri, 14 Jun 2013 08:07:07 +0000 (10:07 +0200)]
typo: lvm.conf: auto_activation_list -> auto_activation_volume_list

11 years agoman: refine lvm.conf and man page documentation for autoactivation feature
Peter Rajnoha [Fri, 14 Jun 2013 07:36:56 +0000 (09:36 +0200)]
man: refine lvm.conf and man page documentation for autoactivation feature

11 years agotests: harness updates
Zdenek Kabelac [Wed, 12 Jun 2013 12:16:25 +0000 (14:16 +0200)]
tests: harness updates

11 years agocleanup: tab
Zdenek Kabelac [Thu, 13 Jun 2013 12:10:49 +0000 (14:10 +0200)]
cleanup: tab

11 years agothin: vgsplit support for thins
Zdenek Kabelac [Thu, 13 Jun 2013 10:05:53 +0000 (12:05 +0200)]
thin: vgsplit support for thins

Support vgsplit for VGs with thin pools and thin volumes.
In case the thin data and thin metadata volumes are moved to a new VG,
move there also all related thin volumes and check that external origins
are also present in this new VG.

11 years agodev-type: refine dev_get_primary_dev return codes and add more comments
Peter Rajnoha [Wed, 12 Jun 2013 12:33:28 +0000 (14:33 +0200)]
dev-type: refine dev_get_primary_dev return codes and add more comments

11 years agodistclean: add missing items
Peter Rajnoha [Wed, 12 Jun 2013 10:51:38 +0000 (12:51 +0200)]
distclean: add missing items

These were missing in distclean target under scripts dir:
  blk_availability_init_red_hat
  blk_availability_systemd_red_hat.service
  blkdeactivate.sh

11 years agocleanup: remove old and unused code to detect partition types
Peter Rajnoha [Wed, 12 Jun 2013 10:46:46 +0000 (12:46 +0200)]
cleanup: remove old and unused code to detect partition types

This part of the code has not been used for ages, if ever.
If needed anytime in future, we should use some library
instead - libblkid?

11 years agofilter-mpath: detect partitions of mpath components
Peter Rajnoha [Wed, 12 Jun 2013 10:20:10 +0000 (12:20 +0200)]
filter-mpath: detect partitions of mpath components

We use mpath filtering (enabled by devices/multipath_component_detection=1
lvm.conf setting) to avoid a situation in which we could end up with
duplicate PVs found. We need to filter out the mpath components and
use only the top-level multipath mapping instead for PV scans.

However, if the there are partitions on multipath components, we need
to filter out these partitions. This patch fixes it so those
partitions found on multipath components are filtered as well.

For example, let's consider following configuration:
The sda and sdb are mpath components, sda1 and sdb1 the partitions
on these components, mpath-test the mpath mapping and mpath-test1
the partition mapping - created automatically by kpartx right
after mpath-test creation. The PV resides on top.

       (LVM PV)
          |
      mpath-test1
          |
      mpath-test
          |
sda1 ---------- sdb1
   \ |        |/
    sda      sdb

E.g. for sda1 and sdb1, the code will detect this and it skips
the partition that belongs to the multipath component:
  <snippet from the log>
    #filters/filter-mpath.c:156         /dev/sda1: Device is a partition, using primary device /dev/sda for mpath component detection
    130 #ioctl/libdm-iface.c:1724         dm status   (253:2) OF[16384](*1)
    131 #filters/filter-mpath.c:196         /dev/sda1: Skipping mpath component device
  </snippet from the log>

Othewise, we'd see the same PV label on sda1/sdb1 and mpath-test1
at the same time ending up with "Duplicate PV found...".

11 years agodev-type: dev_get_primary_dev fn: use dev_types and provide better return codes
Peter Rajnoha [Wed, 12 Jun 2013 10:14:11 +0000 (12:14 +0200)]
dev-type: dev_get_primary_dev fn: use dev_types and provide better return codes

The dev_get_primary_dev fn now returns:

  0 if the dev is already a primary dev
  1 if the dev is a partition, primary dev is returned in "result" (output arg)
  -1 on error

This way, we can better differentiate between the error state
and the state in which the dev supplied is not a partition
in the caller (this was same return value before).

Also, if we already have information about the device type,
we can check its major number against the list of known device
types (cmd->dev_types) directly, so we don't need to go through
the sysfs - we only check the major:minor pair which is a bit
more straightforward and faster. If the dev_types does not have
any info about this device type, the code just fallbacks to
the original sysfs interface to get the partition info.

11 years agorefactor: make device type recognition code common for general use
Peter Rajnoha [Wed, 12 Jun 2013 10:08:56 +0000 (12:08 +0200)]
refactor: make device type recognition code common for general use

Changes:

- move device type registration out of "type filter" (filter.c)
to a separate and new dev-type.[ch] for common use throughout the code

- the structure for keeping the major numbers detected for available
device types and available partitioning available is stored in
"dev_types" structure now

- move common partitioning detection code to dev-type.[ch] as well
together with other device-related functions bound to dev_types
(see dev-type.h for the interface)

The dev-type interface contains all common functions used to detect
subsystems/device types, signature/superblock recognition code,
type-specific device properties and other common device properties
(bound to dev_types), including partitioning support.

- add dev_types instance to cmd context as cmd->dev_types for common use

- use cmd->dev_types throughout as a central point for providing
information about device types

11 years agorefactor: move lib/device/device.c -> lib/device/dev-type.c
Peter Rajnoha [Wed, 12 Jun 2013 09:53:55 +0000 (11:53 +0200)]
refactor: move lib/device/device.c -> lib/device/dev-type.c

11 years agorefactor: move lib/filters/device-types.h -> lib/device/device-types.h
Peter Rajnoha [Wed, 12 Jun 2013 09:46:07 +0000 (11:46 +0200)]
refactor: move lib/filters/device-types.h -> lib/device/device-types.h

11 years agocleanup: use libdm's dm_sysfs_dir() for sysfs directory throughout
Peter Rajnoha [Wed, 12 Jun 2013 09:38:48 +0000 (11:38 +0200)]
cleanup: use libdm's dm_sysfs_dir() for sysfs directory throughout

And remove superfluous cmd->sysfs_dir and
set_sysfs_dir_path/sysfs_dir_path fn from lvm-globals.[ch].

11 years agolvresize: improve poolmetadatasize
Zdenek Kabelac [Tue, 11 Jun 2013 17:46:42 +0000 (19:46 +0200)]
lvresize: improve poolmetadatasize

Fix the usecase when only PV list is specified.
With --poolmetadatasize PV list is used for metadata extents.
Without --poolmetadatasize PV list is used for 100% extension of LV.
Handle the case, when nothing could be resized (i.e. in dmeventd)

11 years agolvresize: fix pvh handling
Zdenek Kabelac [Tue, 11 Jun 2013 12:55:32 +0000 (14:55 +0200)]
lvresize: fix pvh handling

Fix bug in previous patch - if only PVs are specified -
it's like if user would have specified size.

11 years agolibdm: move thin max size to header
Zdenek Kabelac [Wed, 22 May 2013 13:02:55 +0000 (15:02 +0200)]
libdm: move thin max size to header

Move max size of thin metadata into define.
Increase a bit the size to match the kernel size.
(16978542592->17112760320)

11 years agotests: lvresize thin
Zdenek Kabelac [Tue, 11 Jun 2013 11:35:18 +0000 (13:35 +0200)]
tests: lvresize thin

11 years agotests: extend harness
Zdenek Kabelac [Sat, 8 Jun 2013 20:23:39 +0000 (22:23 +0200)]
tests: extend harness

Add limit for buffer so if the test is running in some loop
and generating lots of output, the output log gets too large
for browser to display  (at least Firefox is quite confused
to display 300MB logs).

For now limit max output of one test to 32MB.
If there is need to see full log set LVM_TEST_UNLIMITED to
disable interruption of test.

harness now also prints max memory used during test,
it user and system time and amount of read/write operations.

11 years agothin: enable resize for thin pool metadata LV
Zdenek Kabelac [Tue, 11 Jun 2013 11:11:54 +0000 (13:11 +0200)]
thin: enable resize for thin pool metadata LV

Support 'clasic' way of resizing of metadata LV.
Normally we disallow to work with internal 'invisible' devices.
But in this case we can make an exception and if user has some
special needs how to extend thin pool metadata LV - support it.

After resize of metadata LV, the pool will be suspended and resumed,
to be notified of this change.

11 years agothin: lvresize supports pool metadata resize
Zdenek Kabelac [Tue, 11 Jun 2013 11:45:49 +0000 (13:45 +0200)]
thin: lvresize supports pool metadata resize

Add support for lvresize of thin pool metadata device.

lvresize --poolmetadatasize +20   vgname/thinpool_lv

or

lvresize -L +20 vgname/thinpool_lv_tmeta

Where the second one allows all the args for resize (striping...)
and the first option resizes accoding to the last metadata lv segment.

11 years agothin: add helper functions
Zdenek Kabelac [Tue, 11 Jun 2013 10:32:01 +0000 (12:32 +0200)]
thin: add helper functions

Add find_pool_lv() and pool_can_resize_metadata().

11 years agothin: detect online metadata resize support
Zdenek Kabelac [Tue, 11 Jun 2013 10:31:01 +0000 (12:31 +0200)]
thin: detect online metadata resize support

11 years agothin: report 'e' metadata type with higher priority
Zdenek Kabelac [Wed, 5 Jun 2013 11:46:38 +0000 (13:46 +0200)]
thin: report 'e' metadata type with higher priority

Giving volume type information about being 'metadata' type of volume
has higher priority then i.e.  'mirror' or 'thin' flag - for those
type we have 'target attr' (7th. field).

11 years agothin: report o as volume type for external origin
Zdenek Kabelac [Wed, 5 Jun 2013 11:45:31 +0000 (13:45 +0200)]
thin: report o as volume type for external origin

Reuse 'o' attr for lvs report also for external origin.

11 years agothin: report t for thin pool and volume
Zdenek Kabelac [Wed, 5 Jun 2013 11:44:10 +0000 (13:44 +0200)]
thin: report t for thin pool and volume

Do not mark internal device _tdata and _tmeta as having target type 't'.
They have the target type on their own (i.e. mirror, raid).

11 years agosnapshots: check for active state
Zdenek Kabelac [Tue, 11 Jun 2013 11:07:13 +0000 (13:07 +0200)]
snapshots: check for active state

Fix testing if the snapshot could be resized and use lv_is_active()
to get correct answer in cluster.

11 years agocleanup: skip test if already tested for SIGN_PLUS
Zdenek Kabelac [Tue, 11 Jun 2013 11:09:11 +0000 (13:09 +0200)]
cleanup: skip test if already tested for SIGN_PLUS

11 years agocleanup: remove {}
Zdenek Kabelac [Tue, 11 Jun 2013 11:45:36 +0000 (13:45 +0200)]
cleanup: remove {}

11 years agocleanup: move lv assignment
Zdenek Kabelac [Wed, 5 Jun 2013 11:28:26 +0000 (13:28 +0200)]
cleanup: move lv assignment

Use shorter  lv->.

11 years agoformat1: Fix snapshot reload in lv_remove.
Petr Rockai [Mon, 10 Jun 2013 15:31:13 +0000 (17:31 +0200)]
format1: Fix snapshot reload in lv_remove.

The special suspend/resume code in lv_remove for LVM1 snapshots was interpsersed
with a vg_commit call. However, while with LVM1 metadata, vg_commit is
technically a no-op, the activation code relied on the ondisk and incore
metadata being the same, since on LVM1, a "commit" happens in vg_write
already. Since the "ondisk" metadata was previously not available with format1
(and incore was silently used instead, via lvmcache), the problem was masked.

11 years agoactivation: Pass both ondisk and incore LV to suspend.
Petr Rockai [Tue, 19 Mar 2013 23:00:11 +0000 (00:00 +0100)]
activation: Pass both ondisk and incore LV to suspend.

11 years agometadata: Fix a pool CRC failure due to "late" ondisk copy creation.
Petr Rockai [Mon, 18 Mar 2013 14:46:00 +0000 (15:46 +0100)]
metadata: Fix a pool CRC failure due to "late" ondisk copy creation.

11 years agoActually pass LV metadata to activation code, when available.
Petr Rockai [Sun, 17 Mar 2013 20:49:00 +0000 (21:49 +0100)]
Actually pass LV metadata to activation code, when available.

This ties the two preceding changes together, actually using the "ondisk"
version of VG metadata instead of calling into lvmcache when activating
volumes. The cache hooks are still used as a fallback, because we don't have an
uncached scanning API yet.

11 years agolocking: Make it possible to pass down an LV to activation code.
Petr Rockai [Sun, 17 Mar 2013 20:29:58 +0000 (21:29 +0100)]
locking: Make it possible to pass down an LV to activation code.

Previously, we have relied on UUIDs alone, and on lvmcache to make getting a
"new copy" of VG metadata fast. If the code which triggers the activation has
the correct VG metadata at hand (the version which is currently on disk), it can
now hand it to the activation code directly.

11 years agoAdd and track an "ondisk" pointer to struct volume_group.
Petr Rockai [Sun, 17 Mar 2013 15:27:44 +0000 (16:27 +0100)]
Add and track an "ondisk" pointer to struct volume_group.

This allows us to get the current on-disk version of the metadata whenever we
have the current in-flight version, without a recourse to scanning or lvmcache.

11 years agoMove export_vg_to_config_tree alongside export_vg_to_buffer.
Petr Rockai [Sun, 17 Mar 2013 15:25:12 +0000 (16:25 +0100)]
Move export_vg_to_config_tree alongside export_vg_to_buffer.

This page took 0.098642 seconds and 5 git commands to generate.