summaryrefslogtreecommitdiffstats
path: root/lib/commands
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: replace memset with struct initilizationZdenek Kabelac2012-06-221-3/+1
| | | | | Simplifies the code, properly detects too long socket paths, drops unused parameter.
* Remove unsupported udev_get_dev_path libudev call used for checking udev dir.Peter Rajnoha2012-05-291-12/+16
| | | | | | | | | | | | With latest changes in the udev, some deprecated functions were removed from libudev amongst which there was the "udev_get_dev_path" function we used to compare a device directory used in udev and directore set in libdevmapper. The "/dev" is hardcoded in udev now (udev version >= 183). Amongst other changes and from packager's point of view, it's also important to note that the libudev development library ("libudev-devel") could now be a part of the systemd development library ("systemd-devel") because of the udev + systemd merge.
* Fix error pathZdenek Kabelac2012-05-231-3/+5
| | | | | Do not increase nr_filt in case of NULL ret value, since the error path doesn't handle NULL pointers.
* Fix typo in config option checkZdenek Kabelac2012-03-231-1/+1
|
* Simplify error path code for filter initializationZdenek Kabelac2012-03-121-11/+8
| | | | | Use 'int' counter. Use 'bad' with goto_bad macro.
* Fix error path for create_toolcontextZdenek Kabelac2012-03-121-0/+5
| | | | | | | Never return unfinished toolcontext - since error path is hit on various stages of initialization we cannot leave it partially uninitialized, since we would need to spread many more test across the code for config_valid. Instead return NULL and properly release udev library resources as well.
* Check for udev_get_dev_dir resultZdenek Kabelac2012-03-011-3/+4
| | | | Don't use NULL return value.
* Test result of _init_tags.Zdenek Kabelac2012-02-271-3/+4
|
* The lvmetad client-side integration. Only active when use_lvmetad = 1 is set inPetr Rockai2012-02-231-0/+3
| | | | lvm.conf *and* lvmetad is running.
* Move label_init up in code stackZdenek Kabelac2012-02-081-2/+1
| | | | | | label_exit() is called destroy_toolcontext() and we are now using standard dm_list function for destroy, we have to make sure dm_list gets initialized properly.
* Release allocated resources in error pathZdenek Kabelac2012-02-081-3/+12
| | | | If composite_filter_create() fails, release filters.
* Avoid warning for small pv_min_sizeZdenek Kabelac2012-02-011-3/+3
| | | | Do not print warning for pv_min_size set in range between 512KB and 2MB.
* Reorder fns in libdm-deptree.Alasdair Kergon2012-01-231-8/+1
| | | | Tweak dm_config interface and remove FIXMEs.
* Give priority to emcpower devices with duplicate PVIDs.Alasdair Kergon2012-01-111-1/+1
|
* Add dm_uuid_prefix/dm_set_uuid_prefix for non-lvm users to override hard-codedAlasdair Kergon2012-01-101-0/+3
| | | | | | | LVM- prefix. Try harder not to leave stray empty devices around (locally or remotely) when reverting changes after failures while there are inactive tables.
* Make a cleaner split between config tree and config file functionality. MovePetr Rockai2011-12-181-10/+10
| | | | the latter out of libdm.
* Only use built-in stack size in clvmd - ignore lvm.conf.Alasdair Kergon2011-12-082-2/+6
|
* Add activation/use_linear_target enabled by default. (prajnoha)Alasdair Kergon2011-11-282-0/+5
| | | | | | | | | LVM metadata knows only of striped segments - not linear ones. The activation code detects segments with a single stripe and switches them to use the linear target. If the new lvm.conf setting is set to 0 (e.g. in a test script), this 'optimisation' is turned off.
* Replace dynamic buffer allocations for PATH_MAXZdenek Kabelac2011-11-181-3/+3
| | | | | | | | | | Use static buffer instead of stack allocated buffer. This reduces stack size usage of lvm tool and the change is very simple. Since the whole library is not thread safe - it should not add any new problems - and if there will be some conversion it's easy to convert this to use some preallocated buffer.
* Do not scan device if it is part of active multipath.Milan Broz2011-11-111-1/+9
| | | | | | | | | | | | | | | | | | | Add filter which tries to check if scanned device is part of active multipath. Firstly, only SCSI major number devices are handled in filter. Then it checks if device has exactly one holder (in sysfs) and if it is device-mapper device and DM-UUID is prefixed by "MPATH-". If so, this device is filtered out. The whole filter can be switched off by setting mpath_component_detection in lvm.conf. https://bugzilla.redhat.com/show_bug.cgi?id=597010 Signed-off-by: Milan Broz <mbroz@redhat.com>
* Add find_config_tree_str_allow_emptyZdenek Kabelac2011-10-281-3/+3
| | | | | Add function to allow read of empty strings as valid arguments. Add a warning message if string argument has ignored value.
* Check for refresh_filter failureZdenek Kabelac2011-10-111-2/+3
| | | | | | | | | Properly detect if the filters were refreshed properly. (May needs few more fixes ??) Filter refresh may fail because it may be out of free file descriptors when clvmd gets overloaded.
* Add activation/retry_deactivation to lvm.conf to retry deactivation of an LV.Peter Rajnoha2011-09-221-0/+3
|
* Replace open_count check with holders/mounted_fs check on lvremove path.Peter Rajnoha2011-09-221-0/+1
| | | | | | | | | | | | | | | Before, we used to display "Can't remove open logical volume" which was generic. There 3 possibilities of how a device could be opened: - used by another device - having a filesystem on that device which is mounted - opened directly by an application With the help of sysfs info, we can distinguish the first two situations. The third one will be subject to "remove retry" logic - if it's opened quickly (e.g. a parallel scan from within a udev rule run), this will finish quickly and we can remove it once it has finished. If it's a legitimate application that keeps the device opened, we'll do our best to remove the device, but we will fail finally after a few retries.
* Add missing 'static' for local functionZdenek Kabelac2011-09-021-1/+1
| | | | Avoid missing prototype warning.
* temp notes on dealing with cascadeAlasdair Kergon2011-09-021-0/+9
|
* Move cascade inside libdm etc.Alasdair Kergon2011-09-022-12/+42
| | | | | | Makes dumpconfig whole-section output wrong in a different way from before, but we should be able to merge cft_cmdline properly into cmd->cft now and remove cascade.
* Keep the old-style prototypesZdenek Kabelac2011-09-011-1/+1
|
* Move the core of the lib/config/config.c functionality into libdevmapper,Petr Rockai2011-08-302-31/+36
| | | | | | | leaving behind the LVM-specific parts of the code (convenience wrappers that handle `struct device` and `struct cmd_context`, basically). A number of functions have been renamed (in addition to getting a dm_ prefix) -- namely, all of the config interface now has a dm_config_ prefix.
* Add registration of thin_pool segmentZdenek Kabelac2011-08-251-0/+5
| | | | Register thin and thin_pool segment via multiple_segtypes.
* Fix raid shared lib segtype registration (2.02.87).Alasdair Kergon2011-08-241-26/+10
|
* Add detect_internal_vg_cache_corruption to lvm.confZdenek Kabelac2011-08-111-0/+4
| | | | | | | | | | | Add config option to enable crc checking of VG structures. Currently it's disabled by default. For the internal test-suite this check it is enabled. Note: In the case the internal error is detected, debug build with compile option DEBUG_ENFORCE_POOL_LOCKING helps to catch the source of the problem.
* Add basic RAID segment type(s) support.Jonathan Earl Brassow2011-08-021-19/+27
| | | | | | | | | | | | | 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
* missing ifdef when new fn unusedAlasdair Kergon2011-07-081-0/+2
|
* Ignore activation/verify_udev_operations if dm kernel driver vsn < 4.18.Alasdair Kergon2011-07-081-0/+22
|
* Add framework for validation of ioctls. Doesn't do any checks yet.Alasdair Kergon2011-07-011-0/+3
| | | | | | dmsetup --checks libdevmapper: dm_task_enable_checks() lvm.conf: activation/checks=1
* Remove enforcement of udev verification when using non-standard /dev location.Alasdair Kergon2011-06-281-49/+2
| | | | | If you change the dev dir, it's your responsibility to adjust udev rules or tell lvm not to use udev too.
* Move _set_lvm_fallback into toolcontext, fix string comparison (/devtestAlasdair Kergon2011-06-271-6/+54
| | | | | matched /dev) and note that function should go anyway as it can be overriding a valid config.
* Move udev_only logic inside stacked node op code.Alasdair Kergon2011-06-271-2/+2
| | | | | | (We still need to treat add+readhead+del as a no-op.) Rename udev_fallback to verify_udev_operations. Rename --udevfallback to --verifyudev
* Disable udev fallback by default and add activation/udev_fallback to lvm.conf.Peter Rajnoha2011-06-172-0/+16
| | | | | | | | | | | | | | | | | | | We've used udev fallback code till now to check whether udev created/removed the entries in /dev correctly and if not, a repair was done (giving a warning messagea about that). This patch adds a possibility to enable this additional check and subsequent fallback only when required (debugging purposes mostly) and trust udev completely. So let's disable the fallback code by default and add a new configuration option "activation/udev_fallback". (The original code for creating the nodes will still be used in case the device directory that is set in lvm.conf differs from the one that udev uses and also when activation/udev_rules is set to 0 - otherwise we would end up with no nodes/symlinks at all)
* When glibc needs buffers for line buffering of input and output buffers, itPetr Rockai2011-05-072-2/+32
| | | | | | | | | | | | allocates these buffers in such way it adds memory page for each such buffer and size of unlock memory check will mismatch by 1 or 2 pages. This happens when we print or read lines without '\n' so these buffers are used. To avoid this extra allocation, use setvbuf to set these bufffers ahead. Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com> Reviewed-by: Milan Broz <mbroz@redhat.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
* commands/toolcontext.c:578: warning: ‘udev_dir’ may be used ↵Alasdair Kergon2011-04-291-2/+2
| | | | | | | | uninitialized in this function commands/toolcontext.c:576: warning: ‘udev_dir_len’ may be used uninitialized in this function Bogus - suppress them.
* Set pv_min_size to 2048KB to exclude floppy drives.Alasdair Kergon2011-04-281-1/+1
| | | | Previously was 512.
* Obtain device list from udev by default if LVM2 is compiled with udev support.Peter Rajnoha2011-04-221-0/+21
| | | | | | | | | | | | | | Also, add a new 'obtain_device_list_from_udev' setting to lvm.conf with which we can turn this feature on or off if needed. If set, the cache of block device nodes with all associated symlinks will be constructed out of the existing udev database content. This avoids using and opening any inapplicable non-block devices or subdirectories found in the device directory. This setting is applied to udev-managed device directory only, other directories will be scanned fully. LVM2 needs to be compiled with udev support for this setting to take effect. N.B. Any device node or symlink not managed by udev in udev directory will be ignored with this setting on.
* Replace PV_MIN_SIZE with function pv_min_size()Zdenek Kabelac2011-02-181-1/+10
| | | | | | | | | | | | | | | | | Add configurable option to define minimal size of of block device usable as a PV. pv_min_size() is added to lvm-globals and it's being initialized through _process_config. Macro PV_MIN_SIZE is unused and removed. New define DEFAULT_PV_MIN_SIZE_KB is added to lvm-global and unlike PV_MIN_SIZE it uses KB units. Should help users with various slow devices attached to the system, which cannot be easily filtered out (like FDD on /dev/sdX): https://bugzilla.redhat.com/show_bug.cgi?id=644578
* Fix memory leak in filter creation error pathZdenek Kabelac2011-01-061-2/+5
| | | | | | | If some allocation for peristent filter fails its memory reference was lost, fix it by calling filter's destructor. Fix log_error messages for failing allocation.
* Verbose log old_umask valueZdenek Kabelac2010-12-201-1/+2
| | | | Use old_umask value and print its content through verbose log.
* Add more strict const pointers around config treeZdenek Kabelac2010-12-201-7/+7
| | | | | | To have better control were the config tree could be modified use more const pointers and very carefully downcast them back to non-const (for config tree merge).
* Fix scanning of VGs without in-PV mdas.Alasdair Kergon2010-12-102-0/+5
| | | | | | | | | | | | | | Set cmd->independent_metadata_areas if metadata/dirs or disk_areas in use. - Identify and record this state. Don't skip full scan when independent mdas are present even if memlock is set. - Clusters and OOM aren't supported, so no problem doing the proper scans. Avoid revalidating the label cache immediately after scanning. - A simple optimisation. Support scanning for a single VG in independent mdas. - Not used by the fix but I left it in anyway as later patches might use it.
* Fix check for empty system_dirZdenek Kabelac2010-11-291-1/+1
| | | | Fixing check for zero length system_dir string.