linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] libLVM progress?
@ 2007-07-26 20:00 Ken Stein
  2007-07-26 20:08 ` Alasdair G Kergon
  2007-07-26 20:09 ` Bryn M. Reeves
  0 siblings, 2 replies; 4+ messages in thread
From: Ken Stein @ 2007-07-26 20:00 UTC (permalink / raw)
  To: linux-lvm

Hi all,
I'm working on putting together an automatic menu/popup-based RAID/volume
management configuration utility, and I'm interested in possibly setting
it up to support LVM systems.  Hopefully, the user will be able to plug in
a new hard drive and the system will prompt them as to what they want to
do with it, including adding it to various arrays or logical volumes,
leaving it as reserve space, etc.  I spent some time googling for
information on how to interface with the LVM system, and the only things I
could find were:
* use system() or exec() style calls to run the command line LVM utilities
as needed.  Works, but not exactly elegant, and definitely not efficient.
* 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.
* use a premade LVM interface library.

The last idea came to me when I realized almost everything has a library
these days, so I looked into it, but all I can find is people saying the
current/old liblvm should not be used for new development or as a platform
to base any new liblvm work off of, and people suggesting that a liblvm
project be started to work with the new LVM systems and export a stable,
logical public API.  However, I can't find any mention of actual work
being done on this - if I'm just missing it, a link would be great. 
Otherwise, is there any work I can base a modern liblvm implementation off
of, or anyone I can talk to about joining a liblvm project to help out?

Ken Stein @ kastein@wpi.edu
WPI ECE Class of 2008

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] libLVM progress?
  2007-07-26 20:00 [linux-lvm] libLVM progress? Ken Stein
@ 2007-07-26 20:08 ` Alasdair G Kergon
  2007-07-26 20:09 ` Bryn M. Reeves
  1 sibling, 0 replies; 4+ messages in thread
From: Alasdair G Kergon @ 2007-07-26 20:08 UTC (permalink / raw)
  To: LVM general discussion and development

On Thu, Jul 26, 2007 at 04:00:57PM -0400, Ken Stein wrote:
> * use a premade LVM interface library.
 
> The last idea came to me when I realized almost everything has a library
> these days, so I looked into it, but all I can find is people saying the
> current/old liblvm should not be used for new development or as a platform
> to base any new liblvm work off of, and people suggesting that a liblvm
> project be started to work with the new LVM systems and export a stable,
> logical public API.  However, I can't find any mention of actual work
> being done on this - if I'm just missing it, a link would be great. 
> Otherwise, is there any work I can base a modern liblvm implementation off
> of, or anyone I can talk to about joining a liblvm project to help out?

Work has begun.

The first step is to achieve proper separation of the 'tools' and 'lib'
directories - so the 'tools' directory will only use the new library
interface.   If you watch the lvm-devel list you'll see a number of
patches going into the tree and the new interface evolving.  Feel free
to help out on the lvm-devel mailing list.
 
Alasdair
-- 
agk@redhat.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] libLVM progress?
  2007-07-26 20:00 [linux-lvm] libLVM progress? Ken Stein
  2007-07-26 20:08 ` Alasdair G Kergon
@ 2007-07-26 20:09 ` Bryn M. Reeves
  2007-07-30 14:40   ` Ken Stein
  1 sibling, 1 reply; 4+ messages in thread
From: Bryn M. Reeves @ 2007-07-26 20:09 UTC (permalink / raw)
  To: LVM general discussion and development

-----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-----

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] libLVM progress?
  2007-07-26 20:09 ` Bryn M. Reeves
@ 2007-07-30 14:40   ` Ken Stein
  0 siblings, 0 replies; 4+ messages in thread
From: Ken Stein @ 2007-07-30 14:40 UTC (permalink / raw)
  To: linux-lvm

> 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.

Thanks. Doesn't look too extensive, but it is far better documentation
than some of the closed source I've worked with had.  Along with the
liblvm2cmd header file documentation I think I'll be fine.

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

That's pretty much what I figured, thanks for verifying this.  I've worked
with enough complex, mostly-undocumented, redundant code to know that it
is a Bad Idea (tm) to create more Frankensteins unless it is the only way
possible to support something.

I'm going to see if I can do a bit of code exploration and documentation
in the lib directory, I can't guarantee how much time I'll have to spend
on it though.

Ken Stein @ kastein@wpi.edu
WPI ECE Class of 2008

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-30 14:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-26 20:00 [linux-lvm] libLVM progress? Ken Stein
2007-07-26 20:08 ` Alasdair G Kergon
2007-07-26 20:09 ` Bryn M. Reeves
2007-07-30 14:40   ` Ken Stein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).