summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* python-lvm: Add example code for python-lvm.for-upstreamAndy Grover2012-10-021-0/+107
| | | | | | | | Basic example code for using python-lvm. Originally written by agrover but fixed and improved by tasleson. Signed-off-by: Andy Grover <agrover@redhat.com>
* python-lvm: build infrastructureAndy Grover2012-10-025-1/+65
| | | | | | | | | | | Add a Makefile.in and setup.py.in, along with changes to upper build files as necessary. Add --enable-python-bindings configure option Add install_python_bindings target to toplevel makefile Signed-off-by: Andy Grover <agrover@redhat.com>
* python-lvm: feature parity with liblvmTony Asleson2012-10-021-1/+496
| | | | | | | | | | This patch set brings python-lvm up to date with the features that are currently in lvm2app.h. Minimal unit testing has been done at this time. Signed-off-by: Tony Asleson <tasleson@redhat.com> Signed-off-by: Andy Grover <agrover@redhat.com>
* python-lvm: initial checkin of liblvm.c in liblvm/python/Andy Grover2012-10-021-0/+1217
| | | | | | | | | | | This is a Python C module that wraps liblvm2app's functionality. Originally written by Lars Sjostrom, I have cleaned it up extensively, and it's working well for me. It encapsulates liblvm objects in Python objects, and the object methods are very thin wrappers around the base liblvm library calls. Signed-off-by: Andy Grover <agrover@redhat.com>
* RAID: Fix problems with creating, extending and converting large RAID LVsJonathan Brassow2012-09-274-10/+74
| | | | | | | | | | | | | | | | MD's bitmaps can handle 2^21 regions at most. The RAID code has always used a region_size of 1024 sectors. That means the size of a RAID LV was limited to 1TiB. (The user can adjust the region_size when creating a RAID LV, which can affect the maximum size.) Thus, creating, extending or converting to a RAID LV greater than 1TiB would result in a failure to load the new device-mapper table. Again, the size of the RAID LV is not limited by how much space is allocated for the metadata area, but by the limitations of the MD bitmap. Therefore, we must adjust the 'region_size' to ensure that the number of regions does not exceed the limit. I've added code to do this when extending a RAID LV (which covers 'create' and 'extend' operations) and when up-converting - specifically from linear to RAID1.
* libdaemon: Split daemon-shared.[hc] into daemon-io.[hc] and config-util.[hc].Petr Rockai2012-09-2610-94/+143
|
* libdaemonclient: Use log_sys_error in place of perror.Petr Rockai2012-09-261-1/+1
|
* libdaemonclient: Use dm_{malloc,free} in place of {malloc,free}.Petr Rockai2012-09-261-3/+2
|
* lvremove: Revert to allowing removal of partial LVs.Petr Rockai2012-09-261-6/+0
|
* lvremove: Ask before discarding data areas.Petr Rockai2012-09-261-7/+22
|
* TEST: Workaround for lvmetad vs inconsistent metadata.Petr Rockai2012-09-262-4/+9
|
* lvmetad: Initialise debug_config also if no -d is given.Petr Rockai2012-09-261-0/+1
|
* lvmetad: Give inconsistent metadata warnings in pvscan --cache.Petr Rockai2012-09-262-5/+21
|
* lvmetad: Fix #845269: SEGV on corrupt lvmetad response.Petr Rockai2012-09-262-3/+5
|
* lvmetad: Clear metadata/PV cache before a token-triggered rescan.Petr Rockai2012-09-262-23/+65
|
* lvmetad: Make vgscan --cache an alias to pvscan --cache.Petr Rockai2012-09-261-12/+4
|
* TEST: Add LVM_VALGRIND_LVMETAD to testing options.Petr Rockai2012-09-261-1/+4
|
* Makefiles: Build libdaemonclient unconditionally.Petr Rockai2012-09-263-11/+7
|
* lib/cache/lvmetad: s/pvscan_lvmetad/lvmetad_pvscan/ in the APIPetr Rockai2012-09-263-16/+16
|
* lvmetad: Use "%" PRId64 in place of "%d" for extra clarity.Petr Rockai2012-09-264-15/+18
|
* Implement devices/global_filter.Petr Rockai2012-09-2616-112/+279
| | | | | The global filter is applied first, and is also applied in pvscan --cache (which is called from udev rules to keep lvmetad updated). Cf. example.conf.
* example.conf.in: The command to refresh lvmetad is pvscan --cache.Petr Rockai2012-09-261-1/+1
|
* lib/cache/lvmetad: Refactor to use dm_config_tree in requests.Petr Rockai2012-09-264-111/+137
| | | | | | We were using daemon_send_simple until now, but it is no longer adequate, since we need to manipulate requests in a generic way (adding a validity token to each request), and the tree-based request interface is much more suitable for this.
* libdaemon: Extend and refactor APIs.Petr Rockai2012-09-267-165/+354
| | | | | | | - move common dm_config_tree manipulation functions from lvmetad-core to daemon-shared - add config-tree-based request manipulation APIs to daemon-client - factor out _v (va_list) variants of most variadic functions in libdaemon
* dev-cache: Make it possible to pass in a NULL filter.Petr Rockai2012-09-261-3/+5
|
* filters: Alwayz zalloc the filter struct.Petr Rockai2012-09-265-5/+5
| | | | Not all pointers need to be initialised explicitly that way.
* TEST: Kill lvmetad early in teardown.Petr Rockai2012-09-261-1/+1
|
* cleanup: remove unused variableMarian Csontos2012-09-201-1/+0
|
* Fix tests to accept extended attributeMarian Csontos2012-09-201-4/+4
| | | | attr field had a character (p)artial appended.
* mirror: 'lvconvert --resync' should reset LV_NOTSYNCED on corelog mirrorJonathan Brassow2012-09-193-1/+27
| | | | | | | | | | | | | | | When reformatting the 'lvchange_resync' code in commit 05131f5853e86419d9c726faa961b8d012298d9c, a '!' should have been removed from the condition that checks for the LV_NOTSYNCED flag on a corelog mirror LV. The presence of this '!' caused the LV_NOTSYNCED flag to be cleared when it wasn't present and left when it was present. It is not allowed to add images to a 'mirror' or 'raid1' LV if the LV_NOTSYNCED flag is set. We add some up-convert tests to ensure this behavior is being enforced and that the LV_NOTSYNCED flag is being properly cleared by 'lvchange --resync'. (Not updating WHATS_NEW because this is intrarelease.)
* lvs: add partial attributeAlasdair G Kergon2012-09-193-1/+10
|
* discards: skip when removing LVs on missing PVsAlasdair G Kergon2012-09-193-2/+23
| | | | | | | Don't try to issue discards to a missing PV to avoid segfault. Prevent lvremove from removing LVs that have any part missing. https://bugzilla.redhat.com/857554
* RAID1: Clear the LV_NOTSYNCED flag when a RAID1 LV is converted to linearJonathan Brassow2012-09-142-3/+8
| | | | | | Failing to clear the LV_NOTSYNCED flag when converting a RAID1 LV to linear can result in the flag being present after an upconvert - even if the sync is performed when upconverting.
* RAID1: Like mirrors, do not allow adding images to LV created w/ --nosyncJonathan Brassow2012-09-142-0/+13
| | | | | | | | | | | | | | | Mirrors do not allow upconverting if the LV has been created with --nosync. We will enforce the same rule for RAID1. It isn't hugely critical, since the portions that have been written will be copied over to the new device identically from either of the existing images. However, the unwritten sections may be different, causing the added image to be a hybrid of the existing images. Also, we are disallowing the addition of new images to a RAID1 LV that has not completed the initial sync. This may be different from mirroring, but that is due to the fact that the 'mirror' segment type "stacks" when adding a new image and RAID1 does not. RAID1 will rebuild a newly added image "inline" from the existant images, so they should be in-sync.
* TEST: Add missing test for RAID module versionJonathan Brassow2012-09-121-0/+2
| | | | | RAID10 was added to dm-raid module version 1.3.0. Omitted test for this version is causing test suite to fail.
* systemd: depend on systemd-udev-settle unit in activation unitHEADmasterPeter Rajnoha2012-09-122-2/+3
| | | | | | | | | | | The "fedora-wait-storage.service" that the "lvm2-activation.service" had as a dependency (which was fedora-specific solution anyway) is obsolete now as this unit called "modprobe scsi_wait_scan" which is not used anymore. The "fedora-wait-storage.service" had "systemd-udev-settle" as its dependency, so let's depend on this one directly now, bypassing the out-dated "fedora-wait-storage.service".
* vgchange: fix -aay to activate proper volumesPeter Rajnoha2012-09-122-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | Using 'activation/auto_activation_volume_list = [ "vg/lvol1" ]'. Before this patch: 3 logical volume(s) in volume group "vg" now active LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert lvol0 vg -wi----- 4.00m lvol1 vg -wi-a--- 4.00m lvol2 vg -wi-a--- 4.00m lvol3 vg -wi-a--- 4.00m (vg/lvol1 activated as it passes the list and all subsequent volumes too - wrong!) With this patch: 1 logical volume(s) in volume group "vg" now active LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert lvol0 vg -wi----- 4.00m lvol1 vg -wi-a--- 4.00m lvol2 vg -wi----- 4.00m lvol3 vg -wi----- 4.00m (only vg/lvol1 activated as it passes the list and no other - correct!)
* RAID: Properly handle resync of RAID LVsJonathan Brassow2012-09-112-14/+38
| | | | | | | Issuing a 'lvchange --resync <VG>/<RAID_LV>' had no effect. This is because the code to handle RAID LVs was not present. This patch adds the code that will clear the metadata areas of RAID LVs - causing them to resync upon activation.
* cleanup: Restructure code that handles mirror resyncingJonathan Brassow2012-09-111-29/+86
| | | | | | | | | | | | | | | | | When an LV is to be resynced, the metadata areas are cleared and the LV is reactivated. This is true for mirroring and will also be true for RAID LVs. We restructure the code in lvchange_resync() so that we keep all the common steps necessary (validation of ability to resync, deactivation, activation of meta/log devices, clearing of those devices, etc) and place the code that will be divergent in separate functions: detach_metadata_devices() attach_metadata_devices() The common steps will be processed on lists of metadata devices. Before RAID capability is added, this will simply be the mirror log device (if found). This patch lays the ground-work for adding resync of RAID LVs.
* cleanup: Reduce indentation by short-circuiting functionJonathan Brassow2012-09-112-43/+56
| | | | | | | | | By changing the conditional for resyncing mirrors with core-logs a bit, we can short-circuit the rest of the function for that case and reduce the amount of indenting in the rest of the function. This cleanup will simplify future patches aimed at properly handling the resync of RAID LVs.
* RAID: Disallow addition of RAID images while array is not in-syncJonathan Brassow2012-09-101-0/+4
| | | | | | | | We cannot add images to a RAID array while it is not in-sync. The kernel will simply reject the table, saying: 'rebuild' specified while array is not in-sync Now we check to ensure the LV is in-sync before attempting image additions.
* RAID: '--test' should not cause a valid create command to failJonathan Brassow2012-09-053-0/+10
| | | | | | | | | It is necessary when creating a RAID LV to clear the new metadata areas. Failure to do so could result in a prepopulated bitmap that would cause the new array to skip syncing portions of the array. It is a requirement that the metadata LVs be activated and cleared in the process of creating. However in test mode, this requirement should be lifted - no new LVs should be created or written to.
* cleanup: Use segtype->ops->name() instead of segtype->name where applicableJonathan Brassow2012-09-054-9/+11
| | | | | | | | When printing a message for the user and the lv_segment pointer is available, use segtype->ops->name() instead of segtype->name. This gives a better user-readable name for the segment. This is especially true for the 'striped' segment type, which prints "linear" if there is an area_count of one.
* TEST (lvresize-raid): Also test resizing of RAID10Jonathan Brassow2012-09-051-2/+33
|
* make: fix subdir order for distcleanPeter Rajnoha2012-08-271-2/+2
| | | | | | The 'test' subdir needs to be processed before 'tools' subdir for distclean as all the cmd names are read from 'tools/.commands' file. Otherwise we'd end up with dangling symlinks in 'tools' subdir.
* config: require dm_config_create_value for dm_config_node's valuePeter Rajnoha2012-08-273-7/+10
| | | | | | | | | | | | | | | | | If we were defining a section (which is a node without a value) and the value was created automatically on dm_config_create_node call, we were wasting resources as the next step after creating the config node itself was assigning NULL for the node's value. The dm_config_node_create + dm_config_create_value sequence should be used instead for settings and dm_config_node_create alone for sections. The majority of the code already used the correct sequence. Though with dm_config_node_create fn creating the value as well, the pool memory was being trashed this way. This patch removes the node value initialization on dm_config_create_node fn call and keeps it for the direct dm_config_create_value fn call.
* test: snapshot_extend_threshold -> snapshot_autoextend_thresholdPeter Rajnoha2012-08-272-2/+2
| | | | | Missing the "auto" prefix in the config key name. The unknown setting is silently ignored otherwise.
* setvbuf: reopen only valid fdPeter Rajnoha2012-08-273-24/+34
| | | | | | We should check whether the fd is opened before trying to reopen it. For example, the stdin is closed in test/lib/harness.c causing the test suite to fail.
* tests: testing lvm_lv_renameZdenek Kabelac2012-08-273-2/+87
| | | | Test stacking of rename operation within one udev transaction.
* lvm2api: extend lvm2api with lvm_lv_renameZdenek Kabelac2012-08-273-0/+27
| | | | Add support for LV rename.