[linux-lvm] Question regarding liblvm2cmd

Tim Post echo at echoreply.us
Sat Sep 13 03:43:57 UTC 2008


Hello,

I am working with liblvm2cmd within a program that aims to simplify
typical LV management tasks from a web interface. Using the library
allows me to accomplish this with better sanity and safety.

I noticed that lvm2_run() only has a few possible return values and does
not set a global errno to give more information as to why something may
have failed. I inspected lvm2_run() and _run_command() in tools/.

For instance, if you try to create a LV of a size that exceeds the
capacity of the given VG, its easy to tell that something went wrong and
print the response from lvm in the callback. However, it seems rather
difficult for the calling function to know what went wrong. The user
knows, obviously, by what is printed.

Barring picking apart the strings that would be printed for any given
level, is there some other way to make a program understand the nature
of a failure?

Many thanks in advance.

Cheers,
--Tim





More information about the linux-lvm mailing list