From: Dave Wysochanski <dwysocha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 12/13] First cut at adding pv_obj_* APIs.
Date: Fri, 13 Feb 2009 06:23:12 -0500 [thread overview]
Message-ID: <1234524192.2731.19.camel@f10-node1> (raw)
In-Reply-To: <874ozc75n1.fsf@eriador.mornfall.net>
On Tue, 2009-02-03 at 00:58 +0100, Petr Rockai wrote:
> Hi,
>
> Dave Wysochanski <dwysocha@redhat.com> writes:
> > Impelemnt pv_obj_get(), pv_obj_get_list(), pv_obj_get_attr_list() and
> > pv_obj_get_attr_value().
> >
> > This is a first attempt at adding pv_obj_* APIs as outlined by
> > http://fedoraproject.org/wiki/LVM/liblvm/api
> >
> > Why add another structure when we could use struct physical_volume
> > and other internal structs? At this point it is not clear but would
> > provide us with the ability to more easily allocate and free handles,
> > and would allow places to store things like the access mode and API
> > errors without polluting the internal structures.
> I don't say this is completely wrong, but the naming seems very baroque to me,
> and not at all clear what it means, in relation to pv_t, lv_t and such. Also,
> how does this relate to the idea that we want to push back the concept of a PV
> as away from users as possible? I think Alasdair mentioned that on several
> occasions -- PVs should become implicit, as opposed to explicit. Although it
> might be a stretch for library. Not sure. What do you think?
>
We discussed removing the PV concept from the API earlier this week on a
concall. From my notes/recollection, here is what we concluded:
1. We should aim to ensure a PV is always in a VG, even if it is just
the orphan VG.
2. To obtain a PV object, you must first obtain a VG object.
3. If you want to change a PV attribute, you must first do a
vg_read/vg_open and obtain WRITE permission.
Thomas is going to update the API document.
I agree it is not desirable to introduce another set of structures
unless there is good reason for it. It was an initial implementation
and something Thomas and I were discussing. The reason we were leaning
towards a new structure was we needed a place to store the options for
the create functions (e.g. pvcreate, vgcreate, lvcreate). In some cases
these are attributes of the actual PV, VG, or LV. But in other cases
they are options to control the create behavior. We should probably
think about each of the options specifically and see what the best way
to handle them. I know this wasn't apparent from my patchset here but
as I recall this is why we were adding a new structure.
> As for internal structures, I suppose the major hurdle is the way we allocate
> those in the toolcontext pool (and then maybe their complex interlinked
> nature). I wouldn't say that another layer of, especially
> heap-or-pool-allocated indirection will do any good. I think we already have
> more than is good for us: the lvmcache is keeping a shadow copy of everything
> already in an incompatible format from the struct volume_group and
> friends. This happens to be the on-disk text format in a string buffer. I
> believe this is also due to allocation and linking issues of the current struct
> volume_group representation. So improving the situation with the struct
> volume_group etc. would probably help the lvmcache, as well as the lvmlib
> API. Maybe that would be a worthy investment then, instead of building up
> another incompatible shadow structure?
>
Agreed the internal structures are a bit confusing with various
partially done abstractions, etc. If we can clean them up it would be
great.
> Also, the patch seems to be duplicating a lot of code from previous patches? Or
> were those for different kind of object (listing and checking attributes, eg.)?
>
Probably so - patches were just a first stab.
Thanks for the comments.
next prev parent reply other threads:[~2009-02-13 11:23 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-02 20:49 [PATCH 0/13] liblvm initialization, attribute, and object handling Dave Wysochanski
2009-02-02 20:49 ` [PATCH 01/13] Add system_dir to create_toolcontext() Dave Wysochanski
2009-02-02 20:49 ` [PATCH 02/13] Add lvm_create, lvm_destroy, lvm_reload_config() APIs Dave Wysochanski
2009-02-02 20:49 ` [PATCH 03/13] Move vg_t, lv_t, and pv_t from metadata-exported.h into lvm2.h Dave Wysochanski
2009-02-02 20:50 ` [PATCH 04/13] Add lvm_pv_name, lvm_vg_name, and lvm_lv_name accessors Dave Wysochanski
2009-02-02 20:50 ` [PATCH 05/13] Add lvm_vg_open() Dave Wysochanski
2009-02-02 20:50 ` [PATCH 06/13] Add lvm_vg_close() Dave Wysochanski
2009-02-02 20:50 ` [PATCH 07/13] Add lvm_vg_get_attr_list() libLVM API to return a list of VG attribute names Dave Wysochanski
2009-02-02 20:50 ` [PATCH 08/13] Add lvm_vg_get_attr_value() libLVM API to query to value of a VG attribute Dave Wysochanski
2009-02-02 20:50 ` [PATCH 09/13] Add lvm_lvs_in_vg() API Dave Wysochanski
2009-02-02 20:50 ` [PATCH 10/13] Add lvm_pvs_in_vg() Dave Wysochanski
2009-02-02 20:50 ` [PATCH 11/13] Add lvm_lv_get_attr_list() and lvm_lv_get_attr_value() Dave Wysochanski
2009-02-02 20:50 ` [PATCH 12/13] First cut at adding pv_obj_* APIs Dave Wysochanski
2009-02-02 20:50 ` [PATCH 13/13] Add test code Dave Wysochanski
2009-02-02 23:58 ` [PATCH 12/13] First cut at adding pv_obj_* APIs Petr Rockai
2009-02-13 11:23 ` Dave Wysochanski [this message]
2009-02-02 23:47 ` [PATCH 08/13] Add lvm_vg_get_attr_value() libLVM API to query to value of a VG attribute Petr Rockai
2009-02-13 11:30 ` Dave Wysochanski
2009-02-02 23:45 ` [PATCH 06/13] Add lvm_vg_close() Petr Rockai
2009-02-04 17:11 ` Dave Wysochanski
2009-02-04 20:27 ` Dave Wysochanski
2009-02-02 23:28 ` [PATCH 05/13] Add lvm_vg_open() Petr Rockai
2009-02-04 15:01 ` Dave Wysochanski
2009-02-02 23:25 ` [PATCH 03/13] Move vg_t, lv_t, and pv_t from metadata-exported.h into lvm2.h Petr Rockai
2009-02-04 14:57 ` Dave Wysochanski
2009-02-02 23:22 ` [PATCH 02/13] Add lvm_create, lvm_destroy, lvm_reload_config() APIs Petr Rockai
2009-02-03 0:44 ` [PATCH] Move locking_type reading inside init_locking() Dave Wysochanski
2009-02-03 1:12 ` [PATCH take2] Add lvm_create, lvm_destroy, lvm_reload_config() APIs Dave Wysochanski
2009-02-13 11:42 ` [PATCH 02/13] " Dave Wysochanski
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=1234524192.2731.19.camel@f10-node1 \
--to=dwysocha@redhat.com \
--cc=lvm-devel@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.