Dne 9.5.2018 v 08:52 Oliver Rath napsal(a):
Hi list,
i tried to get some lvm-commands working using example_cmdlib.c
(modified, attached). Unfortunatly the example hangs trying a "lvcreate
--name test --size 12M levg" command:
Hi
Please avoid tweaking code to use cmdlib - it's internal library and
lvm2 is highly recommending to always FORK lvm2 command - instead
of trying to embeded it in your application.
There are numerous memory requirements during certain operation that would be
pretty bad to be imposed for other users tool.
If you want to 'stream' multiple commands - you could pipe lvm shell to
minimize forking, however than error reporting & reaction becomes a bit harder
to play with.
Whats wrong here? Ist there a better api for communicating from other
programs?
It's simply not official API and it's based on internal knowledge and uses
settings from lvm.conf - these settings are tied to use of lvm command.
Imho the python support is deprecated, lvm2app is deprecated, dbus-api
is limited at the moment (right? Didnt find documentation for it), so
the only way seems liblvm or call explicit the lvm-tools.
dBus API is somewhat 'frozen' as there is no active development on this part,
and would be nice to get someone involved into this more...
Regards
Zdenek
_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/