| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
In the same way that process_each_vg() can be passed
a single VG name to process, also allow process_each_lv()
to be passed a single VG name and LV name to process.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
update for pvscan changes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This refactors the code for autoactivation. Previously,
as each PV was found, it would be sent to lvmetad, and
the VG would be autoactivated using a non-standard VG
processing function (the "activation_handler") called via
a function pointer from within the lvmetad notification path.
Now, any scanning that the command needs to do (scanning
only the named device args, or scanning all devices when
there are no args), is done first, before any activation
is attempted. During the scans, the VG names are saved.
After scanning is complete, process_each_vg is used to do
autoactivation of the saved VG names. This makes pvscan
activation much more similar to activation done with
vgchange or lvchange.
The separate autoactivate phase also means that if lvmetad
is disabled (either before or during the scan), the command
can continue with the activation step by simply not using
lvmetad and reverting to disk scanning to do the
activation.
|
| |
|
|
|
|
|
| |
This remains experimental and quite restrictive so should only be used
for testing at this stage. (E.g. lvreduce is not supported.)
|
| |
|
| |
|
|
|
|
| |
Add some tracing message
|
|
|
|
|
|
|
|
| |
Add support for active cache LV.
Handle --cachemode args validation during command line processing.
Rework some lvm2 internal to use lvm2 defined CACHE_MODE enums
indepently on libdm defines and use enum around the code instead
of passing and comparing strings.
|
|
|
|
| |
These settings have been missed in very verbose log.
|
|
|
|
| |
Report passthrough mode instead of 'Unknown feature'.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Don't use lvm_init() to create a full command context, which
does a lot of command setup (like connecting to daemons), which
is unnecessary for simply reading a value from lvm.conf.
Passing a NULL context arg to the lvm_config_ function is now
allowed, in which case lvm.conf is read without doing lvm
command setup.
|
|
|
|
|
|
|
|
|
|
|
| |
A program may be using liblvm2app for simply checking a config
setting in lvm.conf. In this case, a full lvm context is not
needed, only cmd->cft (which are the config settings read from
lvm.conf).
lvm_config_find_bool() can now be passed a NULL lvm context
in which case it will only create cmd->cft, check the config
setting asked for, and destroy the cmd.
|
|
|
|
|
| |
Add a special case to allow modifying a duplicate PV
to erase it with pvremove -ff.
|
|
|
|
|
| |
The old thread locking is very fine grained and complex,
and appears to have no concurrency advantage.
|
|
|
|
|
| |
Use an rwlock for requests that read/write cache state.
Use a mutex for requests that read/write global info.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only call lvm_init() when it's needed so that simply
loading the lvm python code in another program doesn't
make that program do lvm initialization.
The version call doesn't need a handle.
The garbage collection can just do lvm_quit to destroy
the command. The next call that needs lvm_init will
do it first.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When setting up a toolcontext, the lib init function
was detecting an error when there was none, and then
it was returning an incompletely initialized cmd struct
instead of NULL. The effect was that the lib would try
to use the uninitialized cmd struct and segfault.
This would happen if a non-fatal error occurred during
cmd setup, e.g. user permission failed on lvmetad socket,
causing cmd to fall back to scanning and not use lvmetad.
The only real error condition is when create_toolcontext
returns NULL. If cmd is returned, the lib can use it.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
skip on RHEL5 where DEV_USED_FOR_LV doesn't work
because it depends on a newer bit of sysfs.
|
|
|
|
|
|
|
|
|
|
| |
The _report fn is getting big - separate it in two:
- _report fn to get all the options and arguments
- _do_report fn for reporting itself
Also, place all the variables/arguments in one structure for easier
handling of the variables around.
|
| |
|
| |
|
|
|
|
|
| |
Make missing activation() check before calling target_persent
an INTERNAL_ERROR.
|
|
|
|
| |
When activation is disabled, avoid tracing it in cache target.
|
|
|
|
|
| |
Previous patch 8857b227645e97b7cb52ae8d007e87e07db58b4e missed
to check for activation for raid target.
|
| |
|
|
|
|
|
|
| |
Move the message to just before the repair is going
to happen to avoid printing the message in cases
where repair is skipped.
|
|
|
|
| |
The lvm1 part of vgcfgbackup-usage.
|
|
|
|
| |
Split the lvm1 part into a separate test.
|
|
|
|
|
|
| |
Restart clvmd between testing each mdatype to
avoid a problem with dev state being kept from
one test to the next.
|
|
|
|
| |
update for duplicate changes
|
|
|
|
| |
update for duplicate changes
|
|
|
|
| |
Update for new duplicate processing.
|
| |
|
|
|
|
|
|
|
|
| |
If a command begins repopulating the lvmetad cache,
and fails part way through, it should set the disabled
state in lvmetad so other commands don't use bad data.
If a subsequent scan succeeds, the disabled state is
cleared.
|
|
|
|
|
|
|
|
| |
If duplicate devices exist for a PV, and one device's
size matches the PV size, but the other doesn't, then
prefer the matching device.
If one device is used by an active LV, prefer that device.
|
|
|
|
|
|
|
|
|
|
|
|
| |
When there are duplicate devices for a PV, one device
is preferred and chosen to exist in the VG. The other
devices are not used by lvm, but are displayed by pvs
with a new PV attr "d", indicating that they are
unchosen duplicate PVs.
The "duplicate" reporting field is set to "duplicate"
when the PV is an unchosen duplicate, and that field
is blank for the chosen PV.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|