diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2011-06-15 13:29:48 +0000 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2011-06-15 13:29:48 +0000 |
commit | 53dd32f41dc254555b5ffe56c70c15a2a86a0d46 (patch) | |
tree | 4a54965704f0bcc293bc8310e770721652f773fa /liblvm/lvm_base.c | |
parent | 6f14cd22fdb85a2b8f9d73ae419f6564c4cbc41e (diff) | |
download | lvm2-53dd32f41dc254555b5ffe56c70c15a2a86a0d46.tar.gz lvm2-53dd32f41dc254555b5ffe56c70c15a2a86a0d46.tar.xz lvm2-53dd32f41dc254555b5ffe56c70c15a2a86a0d46.zip |
Add proper udev library context initialization and finalization to liblvm.
This was missing in liblvm and it caused all udev-related operations to
not take effect when using liblvm, e.g. obtaining the list of devices from udev
db instead of scanning the whole /dev which also recreated the .cache as a side
effect. This was also the case with udisks-lvm-pv-export prober which is run
from within udev rules whenever the CHANGE event is fired.
Diffstat (limited to 'liblvm/lvm_base.c')
-rw-r--r-- | liblvm/lvm_base.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/liblvm/lvm_base.c b/liblvm/lvm_base.c index f44b786c..99844489 100644 --- a/liblvm/lvm_base.c +++ b/liblvm/lvm_base.c @@ -31,6 +31,9 @@ lvm_t lvm_init(const char *system_dir) /* FIXME: logging bound to handle */ + if (!udev_init_library_context()) + stack; + /* create context */ /* FIXME: split create_toolcontext */ /* FIXME: make all globals configurable */ @@ -69,6 +72,7 @@ lvm_t lvm_init(const char *system_dir) void lvm_quit(lvm_t libh) { destroy_toolcontext((struct cmd_context *)libh); + udev_fin_library_context(); } int lvm_config_reload(lvm_t libh) |