summaryrefslogtreecommitdiffstats
path: root/lib/misc
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-234-26/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* configure: run directory configuration cleanupPeter Rajnoha2012-06-271-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were several hard-coded values for run directory around the code. Also, some tools are DM specific only, others are LVM specific and there was no distinction made here before. With this patch applied, we have this cleaned up a bit (subsystem in brackets, defaults in parentheses): [common] configurable PID_DIR (/var/run) lvm [lvm] configurable RUN_DIR (/var/run/lvm) configurable locking dir (/var/lock/lvm) clvmd [lvm] configurable pid file (PID_DIR/clvmd.pid) socket (RUN_DIR/clvmd.sock) lvmetad [lvm] configurable pid file (PID_DIR/lvmetad.pid) socket (RUN_DIR/lvmetad.socket) dm [dm] configurable DM_RUN_DIR (/var/run) cmirrord [dm] configurable pid file (PID_DIR/cmirrord.pid) dmeventd [dm] configurable pid file (PID_DIR/dmeventd.pid) server fifo (DM_RUN_DIR/dmeventd-server) client fifo (DM_RUN_DIR/dmeventd-client) The changes briefly: - added configure --with-default-pid-dir - added configure --with-default-dm-run-dir - added configure --with-lvmetad-pidfile - by default, using one common pid directory for everything (only lvmetad was not following this before)
* veritysetup: Remove code as now in cryptsetup.Alasdair G Kergon2012-06-111-9/+0
| | | | | The veritysetup code has moved to the cryptsetup package. http://code.google.com/p/cryptsetup/
* More .gitignore files for an in-source-tree build.Alasdair G Kergon2012-06-081-0/+1
| | | | Tell git to ignore files generated by a build inside the source tree.
* Remove unsupported udev_get_dev_path libudev call used for checking udev dir.Peter Rajnoha2012-05-292-15/+0
| | | | | | | | | | | | 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.
* First veritysetup version using configure --with-veritysetup.Alasdair Kergon2012-03-241-0/+9
|
* Add --with-thin-check configure optionZdenek Kabelac2012-03-141-0/+3
| | | | | If specified - use given path without test (Path could be empty) If autodetection is in use - check for command in available PATH.
* Just space movingZdenek Kabelac2012-03-021-2/+2
| | | | Don't leave space on EOL.
* Allow cluster mirrors to handle the absence of the checkpoint lib (libSaCkpt).Jonathan Earl Brassow2012-02-291-0/+3
| | | | | | | | | | | | The OpenAIS checkpoint library is going away; therefore, cmirrord must operate without it. The algorithms the handle the timing of when to send a checkpoint, the determination of what to send, and which ongoing cluster requests are relevent with respect to the checkpoints are unaffected. We need only replace the functions that actually perform the storing/transmitting and retrieving/receiving of the checkpoint data. Rather than store the checkpoint data in an OpenAIS checkpoint file, we simply transmit it along with the message that notifies the incoming node that the checkpoint is ready.
* Add LVMETAD_SUPPORTAlasdair Kergon2012-02-281-0/+3
|
* Add some log_sys_errors to close() callZdenek Kabelac2012-02-271-1/+2
|
* autoreconfPeter Rajnoha2012-02-151-0/+3
|
* Some fixmesZdenek Kabelac2012-02-081-2/+3
| | | | | 'len' calculation is unused ? Unreachable code could be removed or moved upward ?
* Ensure strncpy() function always ends with '\0'Zdenek Kabelac2012-02-082-4/+6
| | | | | Since last character needs to be \0 for string, pass buffer size smaller by 1 byte.
* Avoid warning for small pv_min_sizeZdenek Kabelac2012-02-011-0/+1
| | | | Do not print warning for pv_min_size set in range between 512KB and 2MB.
* Automatically detect whether corosync clvmd needs to use confdb or cmap. (fabio)Alasdair Kergon2012-01-311-0/+3
|
* Differentiate between snapshot status of "Invalid" and "Merge failed".Mike Snitzer2012-01-201-1/+2
|
* Thin uses _tdata instead of _tpool for data LVZdenek Kabelac2011-11-031-1/+1
| | | | Switch to different suffix and keep -tpool reserved for overlay device name.
* Add activation/retry_deactivation to lvm.conf to retry deactivation of an LV.Peter Rajnoha2011-09-222-0/+13
|
* Revert patchZdenek Kabelac2011-09-191-1/+1
| | | | Caller of exec must report log_error when rstatus is passed.
* Use log_error instead of log_verbose when executed command failsZdenek Kabelac2011-09-191-1/+1
|
* Move debug messageZdenek Kabelac2011-09-191-1/+2
| | | | | so it does not look like we are executing command in the middle of critical_section in log trace.
* tdata->tpoolAlasdair Kergon2011-09-061-50/+32
|
* lvcreate parsing for thin provisioning.Alasdair Kergon2011-09-061-0/+12
| | | | The rest is incomplete so this isn't usable yet.
* Match the prototype old-style declarationZdenek Kabelac2011-09-011-1/+1
|
* Move the core of the lib/config/config.c functionality into libdevmapper,Petr Rockai2011-08-302-276/+6
| | | | | | | 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.
* Initial code layout for thin provisioning targetZdenek Kabelac2011-08-241-0/+3
| | | | | | | Only registers init_thin_segtype Option --with-thin=internal needed for compilation. For now useful only for developememt!
* Add detect_internal_vg_cache_corruption to lvm.confZdenek Kabelac2011-08-112-0/+14
| | | | | | | | | | | 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.
* autoreconfAlasdair Kergon2011-08-091-6/+0
|
* Remove meaningless const type qualifiers on cast typeZdenek Kabelac2011-08-041-1/+1
| | | | Static analyzis noticed we do not really need them - so removing.
* Add basic RAID segment type(s) support.Jonathan Earl Brassow2011-08-022-0/+15
| | | | | | | | | | | | | 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
* Add framework for validation of ioctls. Doesn't do any checks yet.Alasdair Kergon2011-07-012-0/+16
| | | | | | dmsetup --checks libdevmapper: dm_task_enable_checks() lvm.conf: activation/checks=1
* Fix create_temp_name to replace any '/' found in the hostname with '?'.Peter Rajnoha2011-06-081-0/+7
| | | | | | | | | | | | | | | There's a possibility someone will use the '/' in the hostname. Since we generate a temporary file name (path) including the hostname, any '/' would be ambiguous. We can always set such hostname using 'sethostname' from unistd.h. But the 'hostname' command already includes the check and removes the '/' char. However, some old versions still allow that. See: https://bugzilla.redhat.com/show_bug.cgi?id=711445. Since this is only a temporary name and the possibility of this error is quite negligible, we don't need any complex escape sequence here, just a simple char replace.
* Set pv_min_size to 2048KB to exclude floppy drives.Alasdair Kergon2011-04-281-1/+0
| | | | Previously was 512.
* Obtain device list from udev by default if LVM2 is compiled with udev support.Peter Rajnoha2011-04-222-0/+13
| | | | | | | | | | | | | | 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.
* Move common libudev code to lvm-wrappers.[ch].Peter Rajnoha2011-04-222-0/+95
| | | | ...so we can use it throughout.
* Fix some unmatching sign comparation gcc warningsZdenek Kabelac2011-04-081-1/+1
| | | | Simple replacement for unsigned type - usually in for() loops.
* Newer gcc doesn't need this trickZdenek Kabelac2011-04-081-1/+1
| | | | In fact it now generates an opposite warning about using undefined variable.
* Fix -Wold-style-definition gcc warningsZdenek Kabelac2011-03-291-12/+12
|
* Revert this commitZdenek Kabelac2011-03-131-1/+1
| | | | | | This buffer allocation must have been problem somewhere else. (as sizeof() already has the 'extra' '\0' included). For now reverting this commit.
* Fix buffer allocation size for uuid stringZdenek Kabelac2011-03-131-1/+1
| | | | | | We have 3 components and traling '\0' so allocate proper room for all of them. Problem was nicely hidden by allocation from pool and allocation aligment offset - so to trigger real problem with this one is actually hard.
* Replace PV_MIN_SIZE with function pv_min_size()Zdenek Kabelac2011-02-182-1/+16
| | | | | | | | | | | | | | | | | 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 CRC32 calculation on big endian CPUZdenek Kabelac2011-02-081-1/+2
| | | | | | Fix regresion from 2.02.75 speedup - so currently crc32 is a little bit more complicated on big-endian CPU as the uint32_t needs to be shifted on here.
* Add configure option --with-device-nodes-onZdenek Kabelac2011-02-041-0/+3
| | | | | | | | | | Make configurable default behaviour how to deal with device node creates. With udev system natural options should be 'resume'. For older systems where user expect there is node in /dev/mapper immediately after dmsetup create --notable - use 'create' FIXME: Code needs fixing passing this flag through udev cookie.
* Skip NULL check before dm_freeZdenek Kabelac2011-01-281-2/+1
| | | | dm_free checks for NULL itself.
* Fix lvchange --test to exit cleanly.Alasdair Kergon2011-01-241-1/+1
|
* Add exec_cmd paramater sync_neededZdenek Kabelac2011-01-132-8/+27
| | | | | | As sync_local_dev_names() cannot be called within activation context, add new parametr which allows to select if the sync call is needed before executing new command.
* Replace fs_unlock by sync_local_dev_names to notify local clvmd. (2.02.80)Alasdair Kergon2011-01-121-1/+1
| | | | Introduce sync_local_dev_names and CLVMD_CMD_SYNC_NAMES to issue fs_unlock.
* Fix missing declaration for fs_unlockZdenek Kabelac2011-01-101-0/+1
|
* Avoid cookie sharing between forked processesZdenek Kabelac2011-01-101-0/+2
| | | | Before fork, ensure cookie is reset so it's not shared between processes.