From: Alasdair G Kergon <agk@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 08/12] Add lvm_errno(), lvm_strerror, lvm_vg_mode.
Date: Sun, 22 Feb 2009 23:11:11 +0000 [thread overview]
Message-ID: <20090222231111.GF15443@agk.fab.redhat.com> (raw)
In-Reply-To: <1234467041-21522-9-git-send-email-dwysocha@redhat.com>
On Thu, Feb 12, 2009 at 02:30:37PM -0500, Dave Wysochanski wrote:
> Create struct lib_context to store lvm_errno field as well as cmd_context.
> Create error APIs - lvm_errno, lvm_strerror.
As we discussed on the call last week, let't see first if we can get an error
number and messages integrated into the existing log_error() reporting
mechanism.
> +int lvm_errno(lvm_handle_t libh)
> +{
> + return libh->lvm_errno;
> +}
Eventually, yes, but as we discussed last week, a static global variable
is likely to be the quickest way to get this working until libh is
available at all levels of the stack.
> +char *lvm_strerror(lvm_handle_t libh)
> +{
> + return strerror(libh->lvm_errno);
> +}
No need for a wrapper around strerror - call it directly!
What we should do though is store the specific error messages issued
and provide a way to return them all in one go.
Again, this is likely to be a simple multi-line string for now, that gets
cleared on each new library call.
Alasdair
--
agk at redhat.com
next prev parent reply other threads:[~2009-02-22 23:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-12 19:30 [RFC PATCH 0/12] dm_report attribute handling and liblvm vg attributes Dave Wysochanski
2009-02-12 19:30 ` [PATCH 01/12] Add dm_report_output_attributes() API to dm_report framework Dave Wysochanski
2009-02-12 19:30 ` [PATCH 02/12] Add system_dir to create_toolcontext() Dave Wysochanski
2009-02-12 19:30 ` [PATCH 03/12] Add lvm_create, lvm_destroy, lvm_reload_config() APIs Dave Wysochanski
2009-02-12 19:30 ` [PATCH 04/12] Move vg_t, lv_t, and pv_t from metadata-exported.h into lvm2.h Dave Wysochanski
2009-02-12 19:30 ` [PATCH 05/12] Add lvm_pv_name, lvm_vg_name, and lvm_lv_name accessors Dave Wysochanski
2009-02-12 19:30 ` [PATCH 06/12] Add lvm_vg_open() Dave Wysochanski
2009-02-12 19:30 ` [PATCH 07/12] Add lvm_vg_close() Dave Wysochanski
2009-02-12 19:30 ` [PATCH 08/12] Add lvm_errno(), lvm_strerror, lvm_vg_mode Dave Wysochanski
2009-02-12 19:30 ` [PATCH 09/12] Update lvm_vg_open() to read and store the list of vg attributes Dave Wysochanski
2009-02-12 19:30 ` [PATCH 10/12] Add lvm_vg_get_attr_list() and lvm_vg_get_attr() Dave Wysochanski
2009-02-12 19:30 ` [PATCH 11/12] Add lvm_vgname_from_vgid() and lvm_get_vgids() Dave Wysochanski
2009-02-12 19:30 ` [PATCH 12/12] Add test code Dave Wysochanski
2009-02-22 23:11 ` Alasdair G Kergon [this message]
2009-02-22 23:39 ` [PATCH 08/12] Add lvm_errno(), lvm_strerror, lvm_vg_mode Alasdair G Kergon
2009-02-22 23:00 ` [PATCH 05/12] Add lvm_pv_name, lvm_vg_name, and lvm_lv_name accessors Alasdair G Kergon
2009-02-22 22:46 ` [PATCH 04/12] Move vg_t, lv_t, and pv_t from metadata-exported.h into lvm2.h Alasdair G Kergon
2009-02-13 13:19 ` [RFC PATCH 0/12] dm_report attribute handling and liblvm vg attributes 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=20090222231111.GF15443@agk.fab.redhat.com \
--to=agk@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.