Peter Rajnoha
b4c05c8519
Add support for systemd file descriptor handover in dmeventd.
...
Systemd preloads file descriptors for us and passes them in for
newly spawned daemon when using on-demand fifo (or socket)
based activation.
This patch adds checks for file descriptors preloaded by
systemd and uses them instead of opening the FIFOs again
to properly support on-demand FIFO-based activation.
(We'll change FIFOs to sockets soon - but still this
part of the code will stay almost the same.)
2011-07-28 13:06:50 +00:00
Peter Rajnoha
9482fdae35
Add support for new oom killer adjustment interface (oom_score_adj).
...
The filename to adjust the oom score was changed in 2.6.36.
We should use oom_score_adj instead of oom_adj (which is still
there under /proc, but it's scheduled for removal in August 2012).
New oom_score_adj uses a range from -1000 (OOM_SCORE_ADJ_MIN,
disable oom killing) to 1000 (OOM_SCORE_ADJ_MAX).
2011-07-28 13:03:37 +00:00
Petr Rockai
4b20b480b1
lvmetad: Edit the MISSING_PV flags only after making a "reply" copy of the
...
metadata, which is then serialised and discarded. This fixes a couple of
outstanding TODO items about handling the MISSING flags correctly.
2011-07-25 17:59:50 +00:00
Petr Rockai
0574adcaa1
lvmetad: Check integrity of multiple metadata copies, i.e. ensure that seqno
...
equality implies metadata equality. Signal error in response to any update
requests that try to overwrite metadata without providing a higher seqno.
2011-07-25 15:51:51 +00:00
Petr Rockai
c33c147c9b
lvmetad: A couple of TODOs, and fix a few trivial memory leaks.
2011-07-25 15:33:04 +00:00
Petr Rockai
3082fa5d4c
lvmetad: Obliterate vg_status by returning the same information from
...
update_pv_status, saving a dozen lines of code and execution time of one
walkthrough of the PV list.
2011-07-20 21:33:41 +00:00
Petr Rockai
7d6fed35c0
lvmetad: Fix a possible infinite loop in vg_status.
2011-07-20 21:27:28 +00:00
Petr Rockai
81535db537
lvmetad: Robustify update_pv_status and remove an useless lookup.
2011-07-20 21:26:18 +00:00
Petr Rockai
b33c9d313f
First stab at making lvmetad-core threadsafe. The current design should allow
...
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.
2011-07-20 21:23:43 +00:00
Petr Rockai
503190e499
lvmetad: Avoid stale PV -> VG mappings on metadata update.
2011-07-20 18:45:32 +00:00
Petr Rockai
fdbde27ed9
Optimise PV -> VG lookups by using a UUID (hash) map.
2011-07-20 18:34:57 +00:00
Petr Rockai
54350d68ce
Free up allocated memory before exiting, in lvmetad.
2011-07-20 18:24:49 +00:00
Petr Rockai
f342b6a862
Fix two small (but eventually unbounded) leaks in daemon-server.c.
2011-07-20 18:23:33 +00:00
Petr Rockai
28b6842556
Can't have a global memory pool in lvmetad (that would constitute an ongoing
...
memory leak) => remove it (it's been unused anyway).
2011-07-20 16:49:21 +00:00
Petr Rockai
ecb4ee0b5a
Make lvmetad also report VGID in reply when adding a PV without MDAs (this
...
obviously only works for VGs that already had at least some MDA discovered).
2011-07-20 16:46:40 +00:00
Petr Rockai
05e87b6b65
Add code to lvmetad's testclient that scans an actual physical device,
...
effectively emulating a future "pvscan --lvmetad" command.
2011-07-20 15:15:41 +00:00
Petr Rockai
9f228ea974
Make lvmetad report the VG ID and status (complete, partial) in reply to pv_add
...
requests.
2011-07-20 15:14:17 +00:00
Petr Rockai
e36cd89437
Towards MISSING (PV) flag management in lvmetad.
2011-07-19 19:15:22 +00:00
Petr Rockai
df4758d73b
Work out some more details in metadata update in lvmetad.
2011-07-19 16:48:13 +00:00
Petr Rockai
8e5d1c93eb
More work on cache maintenance code in lvmetad: keep track of PV status.
2011-07-19 14:13:59 +00:00
Petr Rockai
f20e649ad1
Start filling in the core LVMetaD functionality and the corresponding
...
testclient bits.
2011-07-18 14:48:30 +00:00
Petr Rockai
8e72b3d6d6
Various improvements to the daemon-common code, including automated response
...
formatting from config trees provided by the daemon implementation.
2011-07-18 14:46:54 +00:00
Petr Rockai
8970d1b895
Improve format_buffer in daemon-shared.c, adding block formatting in addition
...
to string/integer (this propagates to the *simple* family of request/response
functionality).
2011-07-18 14:42:44 +00:00
Alasdair Kergon
7a16e1f399
move doc to doc dir
2011-07-08 18:55:28 +00:00
Alasdair Kergon
225d1df8a7
report which dev was not found
2011-07-08 12:35:48 +00:00
Petr Rockai
0952bf42a8
Differentiate the request and response format, in daemon/common.
2011-06-29 22:20:14 +00:00
Zdenek Kabelac
daf9efb723
Annotate CLVMD_CMD_SYNC_NAMES in decode_cmd
2011-06-28 13:42:15 +00:00
Petr Rockai
1a3dab6075
Add int/str lookup routines specific to the reply (in client) and request (in
...
server) for nicer-looking code (thin wrapping around find_config_{int,str}).
2011-06-27 14:03:58 +00:00
Petr Rockai
e828044efd
Also parse the config_tree on the client end (daemon-client.c).
2011-06-27 13:58:11 +00:00
Petr Rockai
a084548cce
Parse the incoming config tree in daemon-server.c, providing the
...
daemon-specific handler with a struct config_tree pointer to look things up in.
2011-06-27 13:46:45 +00:00
Petr Rockai
8d9710bed6
LVMetaD build hack: link to lvm-internal &c. and add a simple test script.
2011-06-27 13:44:33 +00:00
Petr Rockai
0783429215
Implement daemon_send_simple and use it in the testclient.
2011-06-27 13:15:49 +00:00
Petr Rockai
0d7965aeca
Do not open the socket with SOCK_NONBLOCK in daemon-client, since we have no
...
use for that behaviour (at least for now).
2011-06-27 13:14:53 +00:00
Petr Rockai
b5997e5b05
Call daemon_close before exit in the testclient.
2011-06-27 12:27:34 +00:00
Petr Rockai
fbcc8450b8
Sketch out the actual on-wire format in daemon-client.h documentation, and add
...
a simplified send interface.
2011-06-27 12:26:54 +00:00
Petr Rockai
691e08ff76
Add a skeleton for lvmetad, a test client, and a temporary Makefile to build
...
them. These are currently mostly for testing the daemon-common code. LVMetaD
functionality is expected to trickle in soon though.
2011-06-14 02:36:38 +00:00
Petr Rockai
763e834367
Common daemon code: Implement basic socket-based communication infrastructure
...
(both client and server side). The server handles each connection in a separate
thread.
2011-06-14 02:34:18 +00:00
Alasdair Kergon
76564e3168
Major pvmove fix to issue ioctls in the correct order when multiple LVs
...
are affected by the move. (Currently it's possible for I/O to become
trapped between suspended devices amongst other problems.
The current fix was selected so as to minimise the testing surface. I
hope eventually to replace it with a cleaner one that extends the
deptree code.
Some lvconvert scenarios still suffer from related problems.
2011-06-11 00:03:06 +00:00
Peter Rajnoha
e01642db66
Fix a few compile warnings.
...
clvmd-command.c:84:2: warning: implicit declaration of function ‘init_test’
lvm-functions.c:141:3: warning: too many arguments for format
2011-06-03 09:05:30 +00:00
Milan Broz
970f51c102
Use /var/run/lvm for lvmetad socket.
2011-06-02 08:58:05 +00:00
Alasdair Kergon
fe920a6a65
Propagate test mode to clvmd to skip activation and changes to held locks.
2011-06-01 21:16:55 +00:00
Petr Rockai
6a7c185e30
Mention code layout in lvmetad DESIGN.
2011-05-23 14:46:48 +00:00
Petr Rockai
7d37e830ca
More work on the common daemon framework. Make things compile, too.
2011-05-15 11:02:29 +00:00
Petr Rockai
3777234077
More scavenging of common daemon code, this time the clvmd local socket setup
...
sequence.
2011-05-13 09:34:12 +00:00
Petr Rockai
2ca65cc602
Start filling in some of the common daemon (server-side) functionality, taking
...
dmeventd code as a starting point.
2011-05-13 08:45:46 +00:00
Petr Rockai
c2ac1bee92
First go at the lvmetad client-side interface.
2011-05-13 08:17:26 +00:00
Petr Rockai
51fb2c7551
First stab at the prototypes of the daemon-common functionality (to be
...
eventually shared by dmeventd, lvmetad and clvmd).
2011-05-13 08:07:28 +00:00
Petr Rockai
b904359bac
Initial design document for LVMetaD, building on the draft from June of last
...
year, incorporating the outcomes of today's and yesterday's discussions.
2011-05-12 17:49:46 +00:00
Petr Rockai
d792fc925c
When glibc needs buffers for line buffering of input and output buffers, it
...
allocates these buffers in such way it adds memory page for each such buffer
and size of unlock memory check will mismatch by 1 or 2 pages.
This happens when we print or read lines without '\n' so these buffers are
used. To avoid this extra allocation, use setvbuf to set these bufffers ahead.
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Reviewed-by: Milan Broz <mbroz@redhat.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
2011-05-07 13:50:11 +00:00
Zdenek Kabelac
1f7f7cb701
Fix some unmatching sign comparation gcc warnings
...
Simple replacement for unsigned type - usually in for() loops.
2011-04-08 14:40:18 +00:00