Description of problem:
We need lvm to return meaningful error codes
When creating a PV we get:
Fatal error while trying to detect swap signature on /dev/mapper/14f504e46494c45003430363342552
d6c3159732d6d414447\n Device '/dev/mapper/14f504e46494c45003430363342552d6c3159732d6d414447' has been left open.
In our environment we need to remove the dead links in this scenario and we want to do it automatically and cannot rely on text parsing.
We're gradually introducing errno use internally for liblvm to report - eventually every 'log_error()' will set an errno. That's a long-term change. I'm sure we can think up some mechanism to expose these through the command line interface too.
There might be alternative ways to handle specific cases earlier.
Also, any "device has been left open" message is a bug that should be fixed. So there are probably three separate issues on this bz. Using it for the long-term errno change.
Another option: Dave, Peter (and others), would /usr/include/sysexits.h give us enough flexibility instead of using the errno.h range, or are those codes still too generic?
Or we could say 'if it exits with status code EX_OSERR, the last line written to stderr was in a known easy-to-parse format beginning with the internal errno'.
Based on current priorities we can't accommodate this request in RHEL 6.2. Moving to RHEL 6.3 for re-consideration.
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development. This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.
Changes will be considered as part of the ongoing external library development work.
There are no immediate plans to fix this. It isn't important enough to prioritize on it's own. It may be addressed by recent reporting additions and other library work, but it doesn't need to be tracked for years and years.