[linux-lvm] libLVM progress?

Bryn M. Reeves breeves at redhat.com
Thu Jul 26 20:09:11 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ken Stein wrote:
> * use system() or exec() style calls to run the command line LVM utilities
> as needed.  Works, but not exactly elegant, and definitely not efficient.

You'd be better off using the existing liblvm2cmd library. This gives
you a programmatic interface to the command line toolset. It will still
mean formatting commandlines/parsing returns but it cuts down on your
forking and allows the library to cache LVM2 internal data across
command invocations - potentially, that amounts to a big saving.

See doc/example_cmdlib.c in the LVM2 sources for a short example program.

> * delve deeply into the LVM utilities source code to find the ioctl calls
> and/or procfs+sysfs structures being used, then duplicate this in my own
> work.

Not a good idea - there's too much complexity involved and duplicating
that in separate projects would lead to something pretty unmaintainable
quite quickly.

> * use a premade LVM interface library.

There is work in progress to create this kind of interface.

Cheers,
Bryn.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFGqP9n6YSQoMYUY94RAry/AJ4lv4Hpn0FSfK3Tb9jJNiOBdMg0qQCePJPf
Ospgi7Wiz5AyeZxecEbBi74=
=9vKT
-----END PGP SIGNATURE-----




More information about the linux-lvm mailing list