From: Stanley Yue <stanley.yue@gmail.com>
To: Stanley Yue <stanley.yue@gmail.com>,
LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Resend: API for retrieving linux lvm information
Date: Tue, 7 Sep 2004 18:39:24 -0700 [thread overview]
Message-ID: <ce9f1f9e04090718394fa17cde@mail.gmail.com> (raw)
In-Reply-To: <20040907094413.GA6264@agk.surrey.redhat.com>
Alasdair:
Thanks for your response.
Given your last comment, I think i'm going to just perform the parsing
from cmd-line or through /proc/lvm instead if using the apis.
As far as the parsing goes, is it better (in terms of compatibility,
output stability) to parse against the command line output (i.e.
lvdisplay) or against the /proc/filesystems (i.e.
/proc/lvm/VGs/vg00/LVs)?
Also, it is unclear to me what is the meaning of each fields/values by
looking at the information stored in the /proc/* by itself.
[root@DAP-RHLNX1 LVs]# cat /proc/lvm/VGs/vg00/LVs/vol1
name: /dev/vg00/vol1
size: 409600
access: 3
status: 1
number: 0
open: 0
allocation: 0
device: 58:00
For example, what does it mean by "access: 3"?
Is all the information available from query apis (i.e. pvdisplay,
lvdisplay) also available from the /proc/lvm subdirectories?
How can we find out the meaning of each fields/value from the
/proc/lvm information?
Thanks,
Stanley
On Tue, 7 Sep 2004 10:44:13 +0100, Alasdair G Kergon <agk@redhat.com> wrote:
> These answers are for LVM2.
>
> On Mon, Sep 06, 2004 at 11:04:09PM -0700, Stanley Yue wrote:
> > 1) Is there any api library for retrieve linux lvm configuration? I.e.
> > querying for all the vg(s), pv(s), lv(s) on the system?
>
> The commands: lvs, pvs, vgs with numerous cmdline flags.
> See lib/report/columns.h for field names
>
> Access to cmds via library interface: configure --enable-cmdlib
>
> include lvm2cmd.h
>
> Example usage: doc/example_cmdlib.c
>
> Recommend only manipulating one thing at once, so if it
> returns an error you don't have to work out which thing
> went wrong.
>
> [May yet add an optional argc/argv-style entry point.]
>
> > 2) If yes, what license is the library release under?
> The library API is intended to be LGPL.
> It's effectively a wrapper around the command-line interface,
> but more efficient because it's able to cache some internal
> state between commands.
> [I shall correct the copyright notices: the library entry-point
> got moved which messed up the original GPL/LGPL code split.]
>
> liblvm.a does *not* provide a supported API and will sometimes
> change in subtle or incompatible ways without warning. Don't be
> tempted to link against it. The only interface supported
> is the one based on the command-line.
>
> Alasdair
> --
> agk@redhat.com
>
next prev parent reply other threads:[~2004-09-08 1:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-07 6:04 [linux-lvm] Resend: API for retrieving linux lvm information Stanley Yue
2004-09-07 9:44 ` Alasdair G Kergon
2004-09-08 1:39 ` Stanley Yue [this message]
2004-09-08 9:35 ` Alasdair G Kergon
2004-09-08 23:51 ` Stanley Yue
2005-07-13 9:03 ` Dieter Stüken
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ce9f1f9e04090718394fa17cde@mail.gmail.com \
--to=stanley.yue@gmail.com \
--cc=linux-lvm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.