summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* logging: use flags to enable warningsdev-dct-process-v13David Teigland2014-04-233-45/+45
| | | | | | | | | | | The "warnings" arg was used to enable logging of warnings when reading a pv. This arg is turned into a set of flags with the WARN_PV_READ flag matching the existing behavior. A new flag WARN_INCONSISTENT is added that will cause vg_read_internal() to log the "vg is not consistent" warning, and the various callers do not need to log this warning themselves.
* vgreduce: use normal process_each_pvDavid Teigland2014-04-223-83/+76
| | | | In the non-repair case.
* report: handle orphan vgDavid Teigland2014-04-223-4/+38
| | | | | | process_each_pv now passes the orphan vg into process_single, so the reporting code now needs to cope with orphan vgs.
* vgreduce: report an error if a pv is not foundDavid Teigland2014-04-221-3/+11
| | | | | When a pv is explicitly named for reduce, and is not found in the vg, report and return an error.
* lvmdiskscan: ENABLE_ALL_DEVS flagDavid Teigland2014-04-221-1/+1
| | | | | | | | Technically this flag is only used by process_each_pv, which lvmdiskscan does not use at the moment. But add the flag to the lvmdiskscan command definition anyway as "documentation", and in case the implementation is changed to use process_each_pv.
* pvmove: improve comment about searching all vgsDavid Teigland2014-04-221-2/+3
|
* toollib: rename flagDavid Teigland2014-04-223-21/+21
| | | | Use a more descriptive name.
* vgimport: fix all optionDavid Teigland2014-04-221-1/+1
| | | | toollib rework hadn't enabled "all vgs" for vgimport.
* toollib: rename tags function argDavid Teigland2014-04-221-4/+4
| | | | to avoid conflict with any global definition.
* test: add process-each-pv-nomdaDavid Teigland2014-04-221-0/+27
|
* test: add process-each-pv and process-each-pvresizeDavid Teigland2014-04-222-0/+1846
|
* toollib: rewrite process_each_pvDavid Teigland2014-04-228-370/+407
| | | | | | Process pvs by iterating through vgs, then iterating through devs if the command wants to process non-pv devices. The process_single function can always use the vg and pv args.
* toollib: add ENABLE_ALL_DEVS flagDavid Teigland2014-04-222-2/+3
| | | | | | | The ENABLE_ALL_DEVS flag is added to the command structure for commands that should process all devs (pvs and non-pvs) when they call process_each_pv and the command includes the --all arg. This will be used in a later process_each_pv patch.
* toollib: remove unused arg from process_each_lv_in_vgDavid Teigland2014-04-223-4/+2
| | | | | The failed_lvnames arg is no longer used since the cmd_vg replicator wrapper was removed.
* toollib: improve error message in process_each_lv_in_vgDavid Teigland2014-04-221-6/+11
| | | | Include in the error message the lv name args that were not found.
* toollib: rewrite process_each_lvDavid Teigland2014-04-221-297/+334
| | | | | | - Copy the same form as the new process_each_vg. - Replace unused struct cmd_vg and cmd_vg_read() replicator code with struct vg and vg_read() directly.
* toollib: rewrite process_each_vgDavid Teigland2014-04-221-145/+233
| | | | | | | | - Split the collecting of arguments from processing them. - The split allows the two different loops through vgs to be replaced by a single loop. - Replace unused struct cmd_vg and cmd_vg_read() replicator code with struct vg and vg_read() directly.
* toollib: add ENABLE_ALL_VGS flagDavid Teigland2014-04-222-13/+19
| | | | | | | The ENABLE_ALL_VGS flag is added to the command structure for commands that should process all vgs when they call process_each_vg or process_each_lv with no args. This will be used in later patches to process_each functions.
* test: add lvresize testsMarian Csontos2014-04-221-0/+11
| | | | | - test for Bug 1088153 - test lvextend does not reduce nor lvreduce extend LV
* cleanup: dmeventd simplify restart message parsingZdenek Kabelac2014-04-181-7/+2
| | | | | | Since we already check every characted in the message, skip extra callback to strlen, and do the implicit message length checking.
* cleanup: dmeventd drop setting of sizeZdenek Kabelac2014-04-181-11/+5
| | | | Size is not used when msg->data is NULL.
* cleanup: dmeventd improve _handle_requestZdenek Kabelac2014-04-181-28/+29
| | | | | Let the compiler resolve cmd lookup and leave it to optimize it as it needs.
* cleanup: dmeventd improve _clien_write codeZdenek Kabelac2014-04-181-7/+19
| | | | | | | Switch to allocate buffer from heap, since it might be potentially bigger when extremaly large set of volumes would be monitored. In case of allocation failure send ENOMEM message. Also implicitelly ignore msg->size when msg->data is NULL.
* cleanup: dmeventd set next_time when registeringZdenek Kabelac2014-04-181-2/+1
| | | | Don't change next_time, when thread is already registered.
* cleanup: dmeventd improve _get_statusZdenek Kabelac2014-04-181-16/+10
| | | | | | Use directly dm_asprintf() to allocate buffer with message, and properly detect failing on replacement of snprintf() which also returns -1 on error.
* cleanup: dmeventd simplify buffer write loopZdenek Kabelac2014-04-181-6/+6
|
* cleanup: dmeventd simplify status processingZdenek Kabelac2014-04-181-13/+12
| | | | Since we always know the string length, use simplier memcpy.
* cleanup: dmeventd reorder _fill_device_dataZdenek Kabelac2014-04-181-8/+4
| | | | Just simplify the function.
* cleanup: dmeventd abstract lvm2cmd interfaceZdenek Kabelac2014-04-185-11/+7
| | | | | | Keep lvm2cmd interface hidden inside dmeventd_lvm and use regular 1/0 return codes, this we may avoid using lvm2cmd.h in other lvm2 plugins.
* cleanup: add some comment indents...Zdenek Kabelac2014-04-182-17/+16
| | | | Just cleanup things
* cleanup: skip zeroing of cleared areasZdenek Kabelac2014-04-181-12/+5
| | | | Zalloc mem is already zeroed.
* cleanup: set _REENTRANT in headerZdenek Kabelac2014-04-182-3/+1
| | | | | | Use same way of setting _REENTRANT as in other files - set it in the first included header file (clvmd-common.h)
* cleanup: drop inclusion of devmap - mergeZdenek Kabelac2014-04-181-2/+2
|
* cleanup: reduce inclusion of unnecessary headersZdenek Kabelac2014-04-1814-30/+5
| | | | | Remove those file which are not needed by .c files or already include because the headers already needs them.
* cleanup: include stdarg.h where needed.Zdenek Kabelac2014-04-188-4/+12
| | | | | Avoid dependency on implicit inclusion of stdarg.h with libdevmapper.h.
* libdaemon: header cleanupZdenek Kabelac2014-04-188-19/+14
| | | | | | | Ensure daemon-io.h is used as a generic header included with configure defines before other headers. (In future all lvm2 libraries should settle on a single lib.h header) Rename couple defines to better match header file names.
* makefiles: move subdir into same sectionZdenek Kabelac2014-04-181-4/+4
| | | | Just shift few lines
* makefiles: drop linking of deamon libs to pluginsZdenek Kabelac2014-04-185-16/+16
| | | | Daemon lib is linked into lvm2cmd library.
* makefiles: compile files on makeZdenek Kabelac2014-04-181-0/+2
| | | | Make install should install already compiled/generated files.
* makefiles: clear targets in with make cleanZdenek Kabelac2014-04-181-12/+20
| | | | | Make clean usually cleans all compiled files. Make distclean cleans configure generated files
* makefiles: wait till include is populatedZdenek Kabelac2014-04-181-0/+1
| | | | Since libdaemon needs configure.h header, wait forl links.
* devmapper-event: always initialize timeoutZdenek Kabelac2014-04-181-2/+1
| | | | Before calling select, always set all struct members of timeout.
* dmeventd: check for list size within lockZdenek Kabelac2014-04-181-10/+7
| | | | | Move check for _thread_registry list size behind mutex. Use alloca() instead of buffer[count] (they are the same anyway)
* asprintf: fix test for error resultZdenek Kabelac2014-04-182-2/+2
| | | | | On error this function returns -1. Since the functions however do not propagate error upward, it's rather cleanup change.
* thin: dmeventd plugins support more minorsZdenek Kabelac2014-04-182-1/+3
| | | | | Kernel supports upto 1M (20bit) minors. TODO: convert to hash to reduce memory requirements
* unknown: fix mempool used for name allocationZdenek Kabelac2014-04-183-1/+6
| | | | | Use cmd libmem mempool for name allocation, since mem mempool is released after each clvmd command.
* tools: Add --readonly support.Alasdair G Kergon2014-04-1812-21/+96
| | | | | Offer lock-free access to display virtual machine or clustered VG metadata while it might be in use.
* metadata: Fix unlock on VG recovery error path.Alasdair G Kergon2014-04-182-2/+10
| | | | If lock conversion failed it tried to unlock VG that was no longer locked.
* reports: Use X for unknown LV attr when no dm.Alasdair G Kergon2014-04-184-6/+15
| | | | It's safer not to tell people an LV is inactive when we aren't sure.
* pvscan: Use lvmetad_used().Alasdair G Kergon2014-04-182-3/+3
| | | | | | | | | Config variables that are processed during setup prior to calling into particular tools must not be accessed directly afterwards in case the values already got overridden. _process_config() already used the tests I'm removing here to call lvmetad_set_active() and set up lvmetad_used().