summaryrefslogtreecommitdiffstats
path: root/daemons/lvmetad
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-231-1/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* libdaemon: Draft logging infrastructure.Petr Rockai2012-08-081-46/+33
| | | | | | | | | | | - logging is not controlled by "levels" but by "types"; types are independent of each other... implementation of the usual "log level" user-level semantics can be simply done on top; the immediate application is enabling/disabling wire traffic logging independently of other debug data, since the former is rather bulky and can easily obscure almost everything else - all logs go to "outlets", of which we currently have 2: syslog and stderr; which "types" go to which "outlets" is entirely configurable
* lvmetad: Fix an obscure error message.Petr Rockai2012-07-311-2/+1
|
* configure: run directory configuration cleanupPeter Rajnoha2012-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Add fixmesZdenek Kabelac2012-03-231-1/+3
| | | | There is missing some proper reaction when update fails ?
* Always free hash tableZdenek Kabelac2012-03-231-3/+6
| | | | also in error path
* Pass struct device around internally rather than dev_t.Alasdair Kergon2012-03-021-6/+8
| | | | | | | Add 3rd daemon return state "unknown" for lookups that are carried out successfully but don't find the item requested. Avoid issuing error messages when it's expected that a device that's being looked up in lvmetad might not be there.
* Check allocated pointersZdenek Kabelac2012-03-011-63/+135
| | | | | | Test pointers from allocation against NULL. Error paths should be checked, some of them probably need some extesions.
* Reflect new file locations, include file updates etc.Alasdair Kergon2012-02-283-16/+38
|
* Add assert for oldnameZdenek Kabelac2012-02-271-0/+1
| | | | | | | Code cannot proceed if oldname would be NULL. Since lvmetad currently doesn't use logging mechanism of lvm to report internal errors - stay with current code style of lvmetad which uses plain asserts for cases like this.
* Move allocation after check for vgidZdenek Kabelac2012-02-271-1/+4
| | | | | so there is no mem leak on this error path. Also actually check if the hash exists.
* Fix server-side leaks in lvmetad.Petr Rockai2012-02-241-2/+8
|
* Clean up the lvmetad state more thoroughly upon shutdown.Petr Rockai2012-02-241-0/+8
|
* Couple of improvements in the daemon (common + lvmetad) code:Petr Rockai2012-02-232-0/+4
| | | | | - some client-side memory leak fixes - announce and check protocols and protocol versions
* Some reformating for lvmetad uddatesZdenek Kabelac2012-02-232-51/+58
| | | | | | | cleanup gcc warning, use PRIu64 header cleanups const pointer fixes.
* The lvmetad client-side integration. Only active when use_lvmetad = 1 is set inPetr Rockai2012-02-231-2/+1
| | | | lvm.conf *and* lvmetad is running.
* Also use DEFAULT_RUN_DIR for the lvmetad socket on the client side.Petr Rockai2012-02-231-1/+1
|
* Tweak lvmetad a bit more:Petr Rockai2012-02-211-17/+40
| | | | | | - allow at most one PV on any given device - allow PV lookup by device - merge the pvmeta info into VG metadata when responding to vg_lookup
* Drop the now-redundant pvid_to_status hash.Petr Rockai2012-02-151-35/+27
|
* Update lvmetad: use device major/minor pair to track devices. Keep a pvmetaPetr Rockai2012-02-151-79/+118
| | | | | | config tree per PV which is mostly provided by the client, so it can be used to keep track of things like label_sector, PV format, mda count / offsets and so on.
* (lvmetad) Remove unused variable.Petr Rockai2012-02-151-1/+1
|
* In lvmetad, also nuke VGs when all their PVs are stolen by another VG (vgmergePetr Rockai2012-02-151-8/+28
| | | | & vgsplit do this).
* lvmetad server-side update:Petr Rockai2012-02-151-108/+410
| | | | | | | | - rename the hashes to be explicit about the mapping - add VG/PV listing calls to the protocol - cache slightly more of the per-PV state - filter cached metadata - compare the metadata upon metadata_update
* Add some FIXME around allocation codeZdenek Kabelac2012-02-131-8/+15
| | | | Remove also unreachable break..
* Add breaks for casesZdenek Kabelac2012-01-251-3/+3
|
* Clean var declarations to the front of the functionZdenek Kabelac2012-01-251-10/+16
|
* Beef up the lvmetad code with more functionality and a bunch of bugfixes. TherePetr Rockai2012-01-162-38/+161
| | | | | | | | | | | | | | | | | | | used to be a few mis-ordered memory accesses (release and access in the next block). Fix that set_flag could have sometimes corrupted the flags being modified. A few issues with metadata tracking are sorted out as well now, and there are only a few problems remaining before we can integrate lvmetad, mostly on the client side: - metadata areas need to be tracked in lvmetad (most likely to be addressed through an extension of metadata, meaning no special support in lvmetad would be needed) - non-udev scanning code needs to be taught about telling lvmetad about device disappearance (pvscan most importantly) - this last item also needs to mesh with metadata inconsistencies and suddenly-incomplete volume groups (aux disable_dev in tests); udev-based scanning should address this separately and more elegantly
* Fix up lvmetad for the minor API change in dm_config_create.Petr Rockai2011-12-181-2/+2
|
* Only use built-in stack size in clvmd - ignore lvm.conf.Alasdair Kergon2011-12-081-1/+1
|
* Cleanup for lvmetad passing uninit structureZdenek Kabelac2011-10-301-1/+1
| | | | Shown by clang analyzer.
* Use Makefile for daemmons/common library.Zdenek Kabelac2011-09-241-7/+3
| | | | | | | | | Next iteration for better fit of lvmetad compilation. Move build of libdaemon.a into common subdir Makefile. libdaemon.a is device-mapper target. Build and install lvmetad as lvm2 target.
* Few more updates to lvmetad build depsZdenek Kabelac2011-09-191-2/+1
| | | | | It seem lvmetad deps must be expressed after the include. Also adding lvmetad deps to device-mapper target in daemons dir.
* Build fixes for lvmetadZdenek Kabelac2011-09-171-5/+4
| | | | Should now be giving better build order and install lvmetad.
* Fix for gcc compilation warningsZdenek Kabelac2011-09-171-17/+35
| | | | and put _XOPEN_SOURCE so pthread_mutexattr is properly defined.
* Compile fixZdenek Kabelac2011-09-021-1/+1
| | | | Reflecting change in dm_config_value float r -> float f.
* Fix warnings and constness handling in lvmetad-core (adjusting thePetr Rockai2011-08-311-23/+25
| | | | | dm_config_find_node to give non-const node pointer, since that better reflects the contract of that function).
* Get rid of the old lvmetad Makefile.Petr Rockai2011-08-311-33/+0
|
* A compromise integration of LVMetaD into the build: I have kept all thePetr Rockai2011-08-311-0/+59
| | | | | | | | | | daemon/common code in a single libdaemon.a, which is completely private. This is currently linked into the lvmetad binary, and will be linked into LVM (the client part, since static linking only picks up only symbols that are actually used). I have also added --enable/disable-lvmetad to ./configure; although the current default is off, I expect this to be flipped to on shortly. There's no LVM-side support yet, but when there is, even when built, it'll still need to be enabled by an lvm.conf option.
* Adapt LVMetaD to use the new dm_config interfaces.Petr Rockai2011-08-302-44/+46
|
* lvmetad: Edit the MISSING_PV flags only after making a "reply" copy of thePetr Rockai2011-07-251-86/+86
| | | | | metadata, which is then serialised and discarded. This fixes a couple of outstanding TODO items about handling the MISSING flags correctly.
* lvmetad: Check integrity of multiple metadata copies, i.e. ensure that seqnoPetr Rockai2011-07-251-1/+51
| | | | | equality implies metadata equality. Signal error in response to any update requests that try to overwrite metadata without providing a higher seqno.
* lvmetad: A couple of TODOs, and fix a few trivial memory leaks.Petr Rockai2011-07-251-0/+20
|
* lvmetad: Obliterate vg_status by returning the same information fromPetr Rockai2011-07-201-24/+10
| | | | | update_pv_status, saving a dozen lines of code and execution time of one walkthrough of the PV list.
* lvmetad: Fix a possible infinite loop in vg_status.Petr Rockai2011-07-201-4/+1
|
* lvmetad: Robustify update_pv_status and remove an useless lookup.Petr Rockai2011-07-201-3/+2
|
* First stab at making lvmetad-core threadsafe. The current design should allowPetr Rockai2011-07-201-45/+122
| | | | | | | very reasonable amount of parallel access, although the hash tables may become a point of contention under heavy loads. Nevertheless, there should be orders of magnitude less contention on the hash table locks than we currently have on block device scanning.
* lvmetad: Avoid stale PV -> VG mappings on metadata update.Petr Rockai2011-07-201-7/+13
|
* Optimise PV -> VG lookups by using a UUID (hash) map.Petr Rockai2011-07-201-26/+25
|
* Free up allocated memory before exiting, in lvmetad.Petr Rockai2011-07-201-0/+7
|
* Can't have a global memory pool in lvmetad (that would constitute an ongoingPetr Rockai2011-07-201-4/+1
| | | | memory leak) => remove it (it's been unused anyway).