From: Dave Wysochanski <dwysocha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Renamed create_toolcontext function to _create_context and added sys_dir as argument, new functions create_librarycontext and create_toolcontext.
Date: Thu, 11 Dec 2008 22:39:35 -0500 [thread overview]
Message-ID: <1229053175.20795.49.camel@localhost.localdomain> (raw)
In-Reply-To: <20081212010433.GT24785@agk.fab.redhat.com>
On Fri, 2008-12-12 at 01:04 +0000, Alasdair G Kergon wrote:
> > +/* Library Entry point */
> > +struct cmd_context *create_librarycontext(const char *sys_dir)
> > +{
> > + return _create_context(NULL, 0, 1, sys_dir);
> > +}
>
> > +/* Tool Entry point */
> > +struct cmd_context *create_toolcontext(struct arg *the_args, unsigned is_static,
> > + unsigned is_long_lived)
> > +{
> > + return _create_context(the_args, is_static, is_long_lived, NULL);
> > +}
>
> Please don't separate these. All tools will use the same library interface -
> there is to be nothing privileged about the existing tools in the tools dir or
> anaconda - they will both share the same interface. So work out where those
> parameters should live.
>
If we don't separate tool from library init, then we make generic
callers of the library incur the penalty for the tools (e.g. explicitly
setting args = NULL, etc). Or is there an alternative?
Going with the object theme, and along the lines of what Thomas (and
maybe others) have suggested for pvcreate, perhaps a 'struct
lvm_lib_obj' that gets created with default values (such as args ==
NULL) and you have to explicitly set what you want before passing in the
lib_config object to create_toolcontext? Passing NULL there of course
gives you default values as well. Would that be a more acceptable
direction?
next prev parent reply other threads:[~2008-12-12 3:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-11 16:43 [PATCH] Use struct cmd_context* as type for lvm2_handle_t with hidden cmd_context. Accessors and mutators have to be used. (lib/lvm2.h) Thomas Woerner
2008-12-11 16:43 ` [PATCH] Renamed create_toolcontext function to _create_context and added sys_dir as argument, new functions create_librarycontext and create_toolcontext Thomas Woerner
2008-12-11 16:43 ` [PATCH] New lib/lvm2.c for base library functions Thomas Woerner
2008-12-11 16:43 ` [PATCH] New public functions lvm2_reload_config, lvm2_set_config_option and lvm2_reset_config_option Thomas Woerner
2008-12-11 21:49 ` Dave Wysochanski
2008-12-12 1:33 ` Alasdair G Kergon
2008-12-12 11:36 ` Thomas Woerner
2008-12-12 12:45 ` Alasdair G Kergon
2008-12-12 13:04 ` Dave Wysochanski
2008-12-12 1:11 ` [PATCH] New lib/lvm2.c for base library functions Alasdair G Kergon
2008-12-12 1:04 ` [PATCH] Renamed create_toolcontext function to _create_context and added sys_dir as argument, new functions create_librarycontext and create_toolcontext Alasdair G Kergon
2008-12-12 3:39 ` Dave Wysochanski [this message]
2008-12-11 18:45 ` [PATCH] Use struct cmd_context* as type for lvm2_handle_t with hidden cmd_context. Accessors and mutators have to be used. (lib/lvm2.h) Dave Wysochanski
2008-12-12 0:46 ` Alasdair G Kergon
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=1229053175.20795.49.camel@localhost.localdomain \
--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.