summaryrefslogtreecommitdiff
path: root/tools/pvchange.c
Commit message (Collapse)AuthorAgeFilesLines
* cov: clean up pvid and vgid usageDavid Teigland2021-08-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pvid and vgid are sometimes a null-terminated string, and other times a 'struct id', and the two types were often cast between each other. When a struct id was cast to a char pointer, the resulting string would not necessarily be null terminated. Casting a null-terminated string id to a struct id is fine, but is still avoided when possible. A struct id is: int8_t uuid[ID_LEN] A string id is: char pvid[ID_LEN + 1] A convention is introduced to help distinguish them: - variables and struct fields named "pvid" or "vgid" should be null-terminated strings. - variables and struct fields named "pv_id" or "vg_id" should be struct id's. - examples: char pvid[ID_LEN + 1]; char vgid[ID_LEN + 1]; struct id pv_id; struct id vg_id; Function names also attempt to follow this convention. Avoid casting between the two types as much as possible, with limited exceptions when known to be safe and clearly commented. Avoid using variations of strcpy and strcmp, and instead use memcpy/memcmp with ID_LEN (with similar limited exceptions possible.)
* archiving: take archive automaticallyZdenek Kabelac2021-06-091-2/+0
| | | | | | | | | | | | | Instead of calling explicit archive with command processing logic, move this step towards 1st. vg_write() call, which will automatically store archive of committed metadata. This slightly changes some error path where the error in archiving was detected earlier in the command, while now some on going command 'actions' might have been, but will be simply scratched in case of error (since even new metadata would not have been even written). So general effect should be only some command message ordering.
* pvchange: fix file locking deadlockDavid Teigland2021-06-021-1/+26
| | | | | | | | | | | Calling clear_hint_file() to invalidate hints would acquire the hints flock before the global flock which could cause deadlock. The lock order requires the global lock to be taken first. pvchange was always invalidating hints, which was unnecessary; only invalidate hints when changing a PV uuid. Because of the lock ordering, take the global lock before clear_hint_file which locks the hints file.
* clang: ensure vg is definedZdenek Kabelac2021-04-231-3/+3
|
* cleanup: free already checks for NULLZdenek Kabelac2021-03-021-2/+1
|
* device usage based on devices fileDavid Teigland2021-02-231-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The LVM devices file lists devices that lvm can use. The default file is /etc/lvm/devices/system.devices, and the lvmdevices(8) command is used to add or remove device entries. If the file does not exist, or if lvm.conf includes use_devicesfile=0, then lvm will not use a devices file. When the devices file is in use, the regex filter is not used, and the filter settings in lvm.conf or on the command line are ignored. LVM records devices in the devices file using hardware-specific IDs, such as the WWID, and attempts to use subsystem-specific IDs for virtual device types. These device IDs are also written in the VG metadata. When no hardware or virtual ID is available, lvm falls back using the unstable device name as the device ID. When devnames are used, lvm performs extra scanning to find devices if their devname changes, e.g. after reboot. When proper device IDs are used, an lvm command will not look at devices outside the devices file, but when devnames are used as a fallback, lvm will scan devices outside the devices file to locate PVs on renamed devices. A config setting search_for_devnames can be used to control the scanning for renamed devname entries. Related to the devices file, the new command option --devices <devnames> allows a list of devices to be specified for the command to use, overriding the devices file. The listed devices act as a sort of devices file in terms of limiting which devices lvm will see and use. Devices that are not listed will appear to be missing to the lvm command. Multiple devices files can be kept in /etc/lvm/devices, which allows lvm to be used with different sets of devices, e.g. system devices do not need to be exposed to a specific application, and the application can use lvm on its own set of devices that are not exposed to the system. The option --devicesfile <filename> is used to select the devices file to use with the command. Without the option set, the default system devices file is used. Setting --devicesfile "" causes lvm to not use a devices file. An existing, empty devices file means lvm will see no devices. The new command vgimportdevices adds PVs from a VG to the devices file and updates the VG metadata to include the device IDs. vgimportdevices -a will import all VGs into the system devices file. LVM commands run by dmeventd not use a devices file by default, and will look at all devices on the system. A devices file can be created for dmeventd (/etc/lvm/devices/dmeventd.devices) If this file exists, lvm commands run by dmeventd will use it. Internal implementaion: - device_ids_read - read the devices file . add struct dev_use (du) to cmd->use_devices for each devices file entry - dev_cache_scan - get /dev entries . add struct device (dev) to dev_cache for each device on the system - device_ids_match - match devices file entries to /dev entries . match each du on cmd->use_devices to a dev in dev_cache, using device ID . on match, set du->dev, dev->id, dev->flags MATCHED_USE_ID - label_scan - read lvm headers and metadata from devices . filters are applied, those that do not need data from the device . filter-deviceid skips devs without MATCHED_USE_ID, i.e. skips /dev entries that are not listed in the devices file . read lvm label from dev . filters are applied, those that use data from the device . read lvm metadata from dev . add info/vginfo structs for PVs/VGs (info is "lvmcache") - device_ids_find_renamed_devs - handle devices with unstable devname ID where devname changed . this step only needed when devs do not have proper device IDs, and their dev names change, e.g. after reboot sdb becomes sdc. . detect incorrect match because PVID in the devices file entry does not match the PVID found when the device was read above . undo incorrect match between du and dev above . search system devices for new location of PVID . update devices file with new devnames for PVIDs on renamed devices . label_scan the renamed devs - continue with command processing
* lvmcache: renaming functions and variablesDavid Teigland2019-08-161-1/+1
| | | | related to duplicates, no functional changes.
* exported vg handlingDavid Teigland2019-06-251-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The exported VG checking/enforcement was scattered and inconsistent. This centralizes it and makes it consistent, following the existing approach for foreign and shared VGs/PVs, which are very similar to exported VGs/PVs. The access policy that now applies to foreign/shared/exported VGs/PVs, is that if a foreign/shared/exported VG/PV is named on the command line (i.e. explicitly requested by the user), and the command is not permitted to operate on it because it is foreign/shared/exported, then an access error is reported and the command exits with an error. But, if the command is processing all VGs/PVs, and happens to come across a foreign/shared/exported VG/PV (that is not explicitly named on the command line), then the command silently skips it and does not produce an error. A command using tags or --select handles inaccessible VGs/PVs the same way as a command processing all VGs/PVs, and will not report/return errors if these inaccessible VGs/PVs exist. The new policy fixes the exit codes on a somewhat random set of commands that previously exited with an error if they were looking at all VGs/PVs and an exported VG existed on the system. There should be no change to which commands are allowed/disallowed on exported VGs/PVs. Certain LV commands (lvs/lvdisplay/lvscan) would previously not display LVs from an exported VG (for unknown reasons). This has not changed. The lvm fullreport command would previously report info about an exported VG but not about the LVs in it. This has changed to include all info from the exported VG.
* locking: unify global lock for flock and lockdDavid Teigland2019-04-291-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There have been two file locks used to protect lvm "global state": "ORPHANS" and "GLOBAL". Commands that used the ORPHAN flock in exclusive mode: pvcreate, pvremove, vgcreate, vgextend, vgremove, vgcfgrestore Commands that used the ORPHAN flock in shared mode: vgimportclone, pvs, pvscan, pvresize, pvmove, pvdisplay, pvchange, fullreport Commands that used the GLOBAL flock in exclusive mode: pvchange, pvscan, vgimportclone, vgscan Commands that used the GLOBAL flock in shared mode: pvscan --cache, pvs The ORPHAN lock covers the important cases of serializing the use of orphan PVs. It also partially covers the reporting of orphan PVs (although not correctly as explained below.) The GLOBAL lock doesn't seem to have a clear purpose (it may have eroded over time.) Neither lock correctly protects the VG namespace, or orphan PV properties. To simplify and correct these issues, the two separate flocks are combined into the one GLOBAL flock, and this flock is used from the locking sites that are in place for the lvmlockd global lock. The logic behind the lvmlockd (distributed) global lock is that any command that changes "global state" needs to take the global lock in ex mode. Global state in lvm is: the list of VG names, the set of orphan PVs, and any properties of orphan PVs. Reading this global state can use the global lock in sh mode to ensure it doesn't change while being reported. The locking of global state now looks like: lockd_global() previously named lockd_gl(), acquires the distributed global lock through lvmlockd. This is unchanged. It serializes distributed lvm commands that are changing global state. This is a no-op when lvmlockd is not in use. lockf_global() acquires an flock on a local file. It serializes local lvm commands that are changing global state. lock_global() first calls lockf_global() to acquire the local flock for global state, and if this succeeds, it calls lockd_global() to acquire the distributed lock for global state. Replace instances of lockd_gl() with lock_global(), so that the existing sites for lvmlockd global state locking are now also used for local file locking of global state. Remove the previous file locking calls lock_vol(GLOBAL) and lock_vol(ORPHAN). The following commands which change global state are now serialized with the exclusive global flock: pvchange (of orphan), pvresize (of orphan), pvcreate, pvremove, vgcreate, vgextend, vgremove, vgreduce, vgrename, vgcfgrestore, vgimportclone, vgmerge, vgsplit Commands that use a shared flock to read global state (and will be serialized against the prior list) are those that use process_each functions that are based on processing a list of all VG names, or all PVs. The list of all VGs or all PVs is global state and the shared lock prevents those lists from changing while the command is processing them. The ORPHAN lock previously attempted to produce an accurate listing of orphan PVs, but it was only acquired at the end of the command during the fake vg_read of the fake orphan vg. This is not when orphan PVs were determined; they were determined by elimination beforehand by processing all real VGs, and subtracting the PVs in the real VGs from the list of all PVs that had been identified during the initial scan. This is fixed by holding the single global lock in shared mode while processing all VGs to determine the list of orphan PVs.
* add device hints to reduce scanningDavid Teigland2019-01-151-0/+2
| | | | | | | Save the list of PVs in /run/lvm/hints. These hints are used to reduce scanning in a number of commands to only the PVs on the system, or only the PVs in a requested VG (rather than all devices on the system.)
* lvmetad: two phase vg_updateDavid Teigland2016-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a command sent lvmetad new VG metadata in vg_commit(). In vg_commit(), devices are suspended, so any memory allocation done by the command while sending to lvmetad, or by lvmetad while updating its cache could deadlock if memory reclaim was triggered. Now lvmetad is updated in unlock_vg(), after devices are resumed. The new method for updating VG metadata in lvmetad is in two phases: 1. In vg_write(), before devices are suspended, the command sends lvmetad a short message ("set_vg_info") telling it what the new VG seqno will be. lvmetad sees that the seqno is newer than the seqno of its cached VG, so it sets the INVALID flag for the cached VG. If sending the message to lvmetad fails, the command fails before the metadata is committed and the change is not made. If sending the message succeeds, vg_commit() is called. 2. In unlock_vg(), after devices are resumed, the command sends lvmetad the standard vg_update message with the new metadata. lvmetad sees that the seqno in the new metadata matches the seqno it saved from set_vg_info, and knows it has the latest copy, so it clears the INVALID flag for the cached VG. If a command fails between 1 and 2 (after committing the VG on disk, but before sending lvmetad the new metadata), the cached VG retains the INVALID flag in lvmetad. A subsequent command will read the cached VG from lvmetad, see the INVALID flag, ignore the cached copy, read the VG from disk instead, update the lvmetad copy with the latest copy from disk, (this clears the INVALID flag in lvmetad), and use the correct VG metadata for the command. (This INVALID mechanism already existed for use by lvmlockd.)
* tools: Use arg_is_set instead of arg_count.Alasdair G Kergon2016-06-211-13/+13
|
* toollib: add 'parent' field to processing_handle; init report format only if ↵Peter Rajnoha2016-06-201-1/+1
| | | | | | | | | | | | | there's no parent If there's parent processing handle, we don't need to create completely new report group and status report - we'll just reuse the one already initialized for the parent. Currently, the situation where this matter is when doing internal report to do the selection for processing commands where we have parent processing handle for the command itself and processing handle for the selection part (that is selection for non-reporting tools).
* lvmcache: process duplicate PVs directlyDavid Teigland2016-05-061-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, duplicate PVs were processed as a side effect of processing the "chosen" PV in lvmcache. The duplicate PV would be hacked into lvmcache temporarily in place of the chosen PV. In the old way, we had to always process the "chosen" PV device, even if a duplicate of it was named on the command line. This meant we were processing a different device than was asked for. This could be worked around by naming multiple duplicate devs on the command line in which case they were swapped in and out of lvmcache for processing. Now, the duplicate devs are processed directly in their own processing loop. This means we can remove the old hacks related to processing dups as a side effect of processing the chosen device. We can now simply process the device that was named on the command line. When the same PVID exists on two or more devices, one device is preferred and used in the VG, and the others are duplicates and are not used in the VG. The preferred device exists in lvmcache as usual. The duplicates exist in a specical list of unused duplicate devices. The duplicate devs have the "d" attribute and the "duplicate" reporting field displays "duplicate" for them. 'pvs' warns about duplicates, but the formal output only includes the single preferred PV. 'pvs -a' has the same warnings, and the duplicate devs are included in the output. 'pvs <path>' has the same warnings, and displays the named device, whether it is preferred or a duplicate.
* pvchange, pvresize: move exported VG checkDavid Teigland2016-03-101-1/+6
| | | | | | | | | | | | | Allow pvchange and pvresize to process exported VGs, and have them check for the exported state in their single function. Previously, the exported VG state would trigger a failure in vg_read()/ignore_vg() because the VGs are being read with READ_FOR_UPDATE. Because these commands read all VGs to search for the intended PVs, any exported VG would trigger a failure, even if it was not related to the intended PV.
* dbus: add notification from commandsDavid Teigland2016-03-071-0/+2
| | | | | | | When a command modifies a PV or VG, or changes the activation state of an LV, it will send a dbus notification when the command is finished. This can be enabled/disabled with a config setting.
* Use a common message for a used PVDavid Teigland2016-02-251-1/+1
| | | | | | | Change some inconsistent messages and adopt the new wording "PV %s is used by" in place of "PV %s is marked as belonging to" or "PV %s belongs to".
* toollib: add two phase pv processing codeDavid Teigland2016-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is common code for handling PV create/remove that can be shared by pvcreate/vgcreate/vgextend/pvremove. This does not change any commands to use the new code. - Pull out the hidden equivalent of process_each_pv into an actual top level process_each_pv. - Pull the prompts to the top level, and do not run any prompts while locks are held. The orphan lock is reacquired after any prompts are done, and the devices being created are checked for any change made while the lock was not held. Previously, pvcreate_vol() was the shared function for creating a PV for pvcreate, vgcreate, vgextend. Now, it will be toollib function pvcreate_each_device(). pvcreate_vol() was called effectively as a helper, from within vgcreate and vgextend code paths. pvcreate_each_device() will be called at the same level as other process_each functions. One of the main problems with pvcreate_vol() is that it included a hidden equivalent of process_each_pv for each device being created: pvcreate_vol() -> _pvcreate_check() -> find_pv_by_name() -> get_pvs() -> get_pvs_internal() -> _get_pvs() -> get_vgids() -> /* equivalent to process_each_pv */ dm_list_iterate_items(vgids) vg = vg_read_internal() dm_list_iterate_items(&vg->pvs) pvcreate_each_device() reorganizes the code so that each-VG-each-PV loop is done once, and uses the standard process_each_pv function at the top level of the function.
* pv: check for the PV_EXT_USED flag and deny ↵Peter Rajnoha2016-02-151-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pvcreate/pvchange/pvremove/vgcreate on such PV (unless forced) Make sure we won't use a PV that is already marked as used. Normally, VG metadata would stop us from doing that, but we can run into a situation where such metadata is missing because PVs with MDAs are missing and the PVs left are the ones with 0 MDAs. (/dev/sda in this example has 0 MDAs and it belongs to a VG, but other PVs with MDA are missing) $ pvs -o pv_name,pv_mda_count /dev/sda PV #PMda /dev/sda 0 $ pvcreate /dev/sda PV '/dev/sda' is marked as belonging to a VG but its metadata is missing. Can't initialize PV '/dev/sda' without -ff. $ pvchange -u /dev/sda PV '/dev/sda' is marked as belonging to a VG but its metadata is missing. Can't change PV '/dev/sda' without -ff. Physical volume /dev/sda not changed 0 physical volumes changed / 1 physical volume not changed $ pvremove /dev/sda PV '/dev/sda' is marked as belonging to a VG but its metadata is missing. (If you are certain you need pvremove, then confirm by using --force twice.) $ vgcreate vg /dev/sda Physical volume '/dev/sda' is marked as belonging to a VG but its metadata is missing. Unable to add physical volume '/dev/sda' to volume group 'vg'.
* doc: change fsf addressZdenek Kabelac2016-01-211-1/+1
| | | | | Hmm rpmlint suggest fsf is using a different address these days, so lets keep it up-to-date
* pvchange, pvresize: fix lockd_gl() usageDavid Teigland2016-01-181-2/+5
| | | | | | | | When an orphan PV is changed/resized, the lvmlockd global lock is converted from sh to ex. If the command is changing two orphan PVs, the conversion to ex should be done only once.
* Add lvmlockddev-dct-lvmlockd-AZDavid Teigland2015-07-021-0/+8
|
* cleanup: tools: "or use -S for selection" --> "or use --select for selection"Peter Rajnoha2015-03-041-1/+1
|
* cleanup: drop unused value assignZdenek Kabelac2015-02-191-2/+1
| | | | | | | | | | | | | Dop unused value assignments. Unknown is detected via other combination (!linear && !striped). Also change the log_error() message into a warning, since the function is not really returning error, but still keep the INTERNAL_ERROR. Ret value is always set later.
* cleanup: remove deallocate_handle_root arg from destroy_procesing_handle fnwPeter Rajnoha2015-02-131-1/+1
|
* pvchange: no need to initialize selection handle directly, process_each_pv ↵Peter Rajnoha2015-02-131-2/+1
| | | | will do that automatically
* pvchange: Use process_each_pv.Alasdair G Kergon2015-02-121-124/+70
| | | | | | | | Invalid devices no longer included in the counters printed at the end. May now need to use --ignoreskippedcluster if relying upon exit status. If more than one change is requested per-PV, attempt to perform them all. Note that different arguments still handle exit status differently.
* select: initialize selection handle for process_each_* fns with initial ↵Peter Rajnoha2015-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | report type This is a followup patch for previous patchset that enables selection in process_each_* fns to fix an issue where field prefixes are not automatically used for fields in selection criteria. Use initial report type that matches the intention of each process_each_* functions: - _process_pvs_in_vg - PVS - process_each_vg - VGS - process_each_lv and process_each_lv_in_vg - LVS This is not normally needed for the selection handle init, BUT we would miss the field prefix matching, e.g. lvchange -ay -S 'name=lvol0' The "name" above would not work if we didn't initialize reporting with the LVS type at its start. If we pass proper init type, reporting code can deduce the prefix automatically ("lv_name" in this case). This report type is then changed further based on what selection criteria we have. When doing pure selection, not report output, the final report type is purely based on combination of this initial report type and report types of the fields used in selection criteria.
* tools: allow -S|--select for vgchange, lvchange and pvchangePeter Rajnoha2015-02-101-1/+2
|
* pvchange: use processing_handle when processing items for pvchangePeter Rajnoha2015-02-101-10/+35
| | | | | | pvchange is an exception that does not use toollib yet for iterating over the list of PVs (process_each_pv) so intialize the processing_handle and use just like it's used in toollib.
* tools: read yes_no_arg via int_valueZdenek Kabelac2014-10-241-12/+3
| | | | yes_no_arg is already parsed so read parsed value as int.
* report: select: refactor: move str_list to libdmPeter Rajnoha2014-06-171-1/+1
| | | | | | | | | | The list of strings is used quite frequently and we'd like to reuse this simple structure for report selection support too. Make it part of libdevmapper for general reuse throughout the code. This also simplifies the LVM code a bit since we don't need to include and manage lvm-types.h anymore (the string list was the only structure defined there).
* cleanup: make error message more readableZdenek Kabelac2014-05-211-1/+1
|
* pvchange: populate lvmcache for --allZdenek Kabelac2014-03-281-0/+4
| | | | When running pvchange --all learn about available VGs from lvmetad.
* pvchange: fix exit code regressionZdenek Kabelac2014-03-271-1/+2
| | | | | | | | | | | | | Commit 1a832398a7caa96faab2ccbac773cc4047c8f9c1 moved some code from _pvchange_single() to main pvchange() and introduced exit code regression as return codes have not been properly changed, thus pvchange command exited with '0' exit code, even though it has reported error. Also there is a missing vg unlock in error path. Fix it by counting the total number of expected calls before checking for pvname and also unlock and relase vg when pv is not found.
* locking: Make it possible to pass down an LV to activation code.Petr Rockai2013-06-101-1/+1
| | | | | | | 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.
* pv_write: clean up non-orphan format1 PV writePeter Rajnoha2013-03-251-28/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...to not pollute the common and format-independent code in the abstraction layer above. The format1 pv_write has common code for writing metadata and PV header by calling the "write_disks" fn and when rewriting the header itself only (e.g. just for the purpose of changing the PV UUID) during the pvchange operation, we had to tweak this functionality for the format1 case and we had to assign the PV the orphan state temporarily. This patch removes the need for this format1 tweak and it calls the write_disks with appropriate flag indicating whether this is a PV write call or a VG write call, allowing for metatada update for the latter one. Also, a side effect of the former tweak was that it effectively invalidated the cache (even for the non-format1 PVs) as we assigned it the orphan state temporarily just for the format1 PV write to pass. Also, that tweak made it difficult to directly detect whether a PV was part of a VG or not because the state was incorrect. Also, it's not necessary to backup and restore some PV fields when doing a PV write: orig_pe_size = pv_pe_size(pv); orig_pe_start = pv_pe_start(pv); orig_pe_count = pv_pe_count(pv); ... pv_write(pv) ... pv->pe_size = orig_pe_size; pv->pe_start = orig_pe_start; pv->pe_count = orig_pe_count; ...this is already done by the layer below itself (the _format1_pv_write fn). So let's have this cleaned up so we don't need to be bothered about any 'format1 special case for pv_write' anymore.
* cleanup: switch log_error to log_warnZdenek Kabelac2012-10-171-4/+4
| | | | | | | Use log_warn to print non-fatal warning messages. Use of log_error would confuse checker for testing whether proper error has been reported for some real error.
* config: add silent modeAlasdair G Kergon2012-08-251-5/+5
| | | | | | | | | | | | | | | | Accept -q as the short form of --quiet. Suppress non-essential standard output if -q is given twice. Treat log/silent in lvm.conf as equivalent to -qq. Review all log_print messages and change some to log_print_unless_silent. When silent, the following commands still produce output: dumpconfig, lvdisplay, lvmdiskscan, lvs, pvck, pvdisplay, pvs, version, vgcfgrestore -l, vgdisplay, vgs. [Needs checking.] Non-essential messages are shifted from log level 4 to log level 5 for syslog and lvm2_log_fn purposes.
* Move the core of the lib/config/config.c functionality into libdevmapper,Petr Rockai2011-08-301-1/+1
| | | | | | | 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.
* Replace free_vg with release_vgZdenek Kabelac2011-08-101-4/+4
| | | | | | | | Move the free_vg() to vg.c and replace free_vg with release_vg and make the _free_vg internal. Patch is needed for sharing VG in vginfo cache so the release_vg function name is a better fit here.
* Allow non-orphan PVs with two metadata areas to be resized.Peter Rajnoha2011-02-281-2/+2
| | | | | | | | | We allow writing non-orphan PVs only for resize now. The "orphan PV" assert in pv_write fn uses the "allow_non_orphan" parameter to control this assert. However, we should find a more elaborate solution so we can remove this restriction altogether (pv_write together with vg_write is not atomic, we need to find a safe mechanism so there's an easy revert possible in case of an error).
* Add old_uuid field to struct physical_volume so we can still reference a PVPeter Rajnoha2011-02-211-0/+1
| | | | | with its old UUID when we're changig it (the cache as well as metadata area index has the old uuid that we need to use to access the information!)
* Change pv_write code to work with the changes in metadata handling interfacePeter Rajnoha2011-02-211-2/+2
| | | | and changes in format_instance.
* Add change_tag to toollib.Alasdair Kergon2011-01-241-58/+35
| | | | Allow multiple pvchange command line options to be specified together.
* Fix wrongly paired unlocking of global lock in pvchange. (2.02.66)Milan Broz2010-12-231-1/+1
|
* Rename vg_release to free_vg.Alasdair Kergon2010-12-081-4/+4
|
* Support repetition of --addtag and --deltag arguments.Alasdair Kergon2010-11-111-13/+20
| | | | | Add infrastructure for specific cmdline arguments to be repeated in groups. Split the_args cmdline arguments and values into arg_props and arg_values.
* Add escape sequence for ':' and '@' found in device names used as PVs.Peter Rajnoha2010-09-231-1/+3
|
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-2/+2
|