summaryrefslogtreecommitdiff
path: root/daemons/dmeventd
Commit message (Collapse)AuthorAgeFilesLines
* dmeventd: reorder mempool allocationZdenek Kabelac2015-09-031-10/+11
| | | | | | Since lvm2_init() effectively detects memory leaks allocate mempool after this initialization (so it's not reported as leak).
* gitignore: Update for in-place build.Alasdair G Kergon2015-07-271-0/+1
|
* include: Standardise around new tool.h.Alasdair G Kergon2015-07-062-17/+4
|
* dmeventd: better debugZdenek Kabelac2015-06-151-45/+15
| | | | Avoid using 'static' variable within threaded environmnent for debuging.
* dmeventd: drop stackZdenek Kabelac2015-06-151-4/+2
|
* dmeventd: drop pthread_cancelZdenek Kabelac2015-06-151-2/+1
| | | | | Drop unused pthread canceling as well as DEBUG printing in signal handler.
* libdm: Add dm_task_get_errno to return ioctl errno.Alasdair G Kergon2015-05-261-11/+14
| | | | | | | | | | There are reports of unexplained ioctl failures when using dmeventd. An explanation might be that the wrong value of errno is being used. Change libdevmapper to store an errno set by from dm ioctl() directly and provide it to the caller through a new dm_task_get_errno() function. [Replaced f9510548667754d9209b232348ccd2d806c0f1d8]
* debug: use epoch for dmeventd loggingZdenek Kabelac2015-04-201-1/+2
| | | | | When LVM_LOG_FILE_EPOCH is set, route lvm command debug message to lvm.conf log file instead of syslog.
* dmeventd: Call lvscan --cache also for mirrors (in addition to RAID).Petr Rockai2015-01-141-0/+10
|
* dmeventd: Add basic thread debugging messages.Alasdair G Kergon2014-11-041-2/+89
| | | | Only with -DDEBUG.
* dmeventd: Include shutdown threads in responses.Alasdair G Kergon2014-11-041-0/+12
| | | | | | | | | | | | | | | When responding to DM_EVENT_CMD_GET_REGISTERED_DEVICE no longer ignore threads that have already been unregistered but which are still present. This means the caller can unregister a device and poll dmeventd to ensure the monitoring thread has gone away before removing the device. If a device was registered and unregistered in quick succession and then removed, WAITEVENT could run in parallel with the REMOVE. Threads are moved to the _thread_registry_unused list when they are unregistered.
* dmeventd: Remove redundant checks.Alasdair G Kergon2014-11-041-10/+4
| | | | | | | The status of threads in _thread_registry is always DM_THREAD_RUNNING (zero). DM_EVENT_REGISTRATION_PENDING is never stored in thread->events.
* dmeventd: fix test for select return valueZdenek Kabelac2014-08-191-1/+9
| | | | | | Do not call read when select return -1 && EINTR. Also check for return valuer from read() and abort write function when unexpected error happens.
* dmeventd: Call lvscan --cache in the RAID plugin.Petr Rockai2014-07-221-0/+10
|
* cleanup: indent in devmapper-eventZdenek Kabelac2014-04-301-15/+12
| | | | | Drop header inclusion - this file is already included. Shorten code.
* devmapper-event: always initialize timeoutZdenek Kabelac2014-04-301-4/+2
| | | | Always pass fully initialized timeval struct to select.
* 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: drop inclusion of devmap - mergeZdenek Kabelac2014-04-181-2/+2
|
* cleanup: include stdarg.h where needed.Zdenek Kabelac2014-04-183-0/+3
| | | | | Avoid dependency on implicit inclusion of stdarg.h with libdevmapper.h.
* makefiles: drop linking of deamon libs to pluginsZdenek Kabelac2014-04-185-16/+16
| | | | Daemon lib is linked into lvm2cmd library.
* 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)
* thin: dmeventd plugins support more minorsZdenek Kabelac2014-04-181-1/+2
| | | | | Kernel supports upto 1M (20bit) minors. TODO: convert to hash to reduce memory requirements
* cleanup: use DM_ARRAY_SIZEZdenek Kabelac2014-04-081-1/+1
| | | | More use of libdevmapper macro
* cleanup: use dm_free without extra testZdenek Kabelac2014-03-251-4/+4
| | | | It's ok to free(NULL).
* cleanup: initilization of varsZdenek Kabelac2014-03-251-3/+3
|
* cleanup: indentZdenek Kabelac2014-03-251-3/+2
|
* cleanup: use NULL for pointer resetZdenek Kabelac2014-03-251-3/+2
|
* cleanup: use 'define' for systemd runtime unit file directoryPeter Rajnoha2014-03-141-1/+2
|
* cleanup: dmeventd convert multiline to single lineZdenek Kabelac2014-03-101-10/+2
| | | | | | | Instead of doing multiple different calls, select stream within a condition. Replace fprintf with fputc for '\n'
* cleanup: dmeventd code simplifiedZdenek Kabelac2014-03-101-7/+7
| | | | Improve readbility of code.
* dmeventd: wakeup timeout thread earlierZdenek Kabelac2014-03-101-0/+2
| | | | | | | | | When the last entry in the timeout queue is unregistered, wakeup sleeping condition, so the thread is deleted earlier. So the thread resource is release earlier. Also when monitored with tools like valgrind this eliminites reported leak.
* dmeventd: remember number of log disablingsZdenek Kabelac2014-03-101-2/+14
| | | | | | | | | | | | | | | Individual events are handled through separate threads, so once we have more then a single thread in this eventwait sleeping, we got race on the dm_log setting, since if one event is timeout out on alarm, while another is still waiting, then dm log has been restored to NULL and the next sigalarm has been reported as error. Fix it by introducing counter which is protected via mutex, and only when the last event is released, logging is restored. TODO: libdm seems to have some static vars which may audit for this type of use.
* coverity: check dm_strncpy return value in dmeventd/_get_parametersPeter Rajnoha2014-02-201-1/+2
|
* libdevmapper-event: Print a deprecation warning for non-default plugins.Petr Rockai2014-02-101-0/+7
|
* dmeventd: check pidfile for exit instead of polling via protocolPeter Rajnoha2014-02-061-30/+9
| | | | | Since we use unlink + _exit now on dmeventd DIE message, we can check the pidfile existence to see whether the dmeventd has finished.
* dmeventd: use _exit(0) instead of raise(9) on dmeventd DIE messagePeter Rajnoha2014-02-061-1/+2
| | | | Just a cleaner way to die.
* dmeventd: add DM_EVENT_GET_PARAMETERS request to dmeventd protocolPeter Rajnoha2014-02-063-2/+60
| | | | | | | | | | | | | The DM_EVENT_GET_PARAMETERS requests the parameters under which the running dmeventd is run and the it sends them to caller. The parameters sent: - the pid of the running dmeventd - foreground state - exec_method (currently either "direct" or "systemd") The exact message sent back: pid=<pid> daemon=<no/yes> exec_method=<direct/systemd>
* dmeventd: fix dmeventd -R to work properly with systemdPeter Rajnoha2014-02-061-6/+95
| | | | | | | | | | | | | | | | | Trying to restart dmeventd as a reload action is causing problems under systemd environment. The systemd loses track of new dmeventd this way. See also https://bugzilla.redhat.com/show_bug.cgi?id=1060134 for more info. We need to call dmeventd -R directly instead of "systemctl reload dm-event.service" that was used before (the reload is aimed at configuration reload anyway, not stateful restart of the daemon - we did this before just because there's no ExecRestart in systemd and there's only ExecStart and ExecStop with which we'd lose the state). Also, use ExecStart="dmeventd -f" to run dmeventd in foreground (and let's rely on systemd to daemonize it) and change the service type from "forking" to "simple".