[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel] [PATCH 08/12] Add lvm_errno(), lvm_strerror, lvm_vg_mode.



On Sun, Feb 22, 2009 at 11:11:11PM +0000, Alasdair G Kergon wrote:
> 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.
 
So take those as two separate problems.

(1) Add another output mechanism to print_log() to cache messages in memory.
Like the other mechanisms, the application should be able to configure what severity
of message it wants recording.
Needs a way to obtain the cached messages (returned as a single multi-line
string?) and a way to clear them (hooked automatically at the start of every
library function).

(2) Setting the library return code.
Have the level that wants to generate the error set it explicitly.
There'd be a default value that would be returned if it has not
been set to something else.  Only the first value would be returned - if
the function to set it is called a second time, that call would not
change the value.  This has the advantage that we only have to deal with
the places where it's actually useful to distinguish between different
errors - and I still don't think there are many such places.

Alasdair
-- 
agk redhat com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]