mirror of
git://sourceware.org/git/lvm2.git
synced 2025-04-01 18:50:41 +03:00
Add lvm_library_get_version() and update unit tests to display version.
This commit is contained in:
parent
98418e2b6e
commit
f7bc94ac3a
@ -1,3 +1,4 @@
|
||||
lvm_library_get_version
|
||||
lvm_init
|
||||
lvm_quit
|
||||
lvm_config_reload
|
||||
|
14
liblvm/lvm.h
14
liblvm/lvm.h
@ -28,6 +28,20 @@
|
||||
*/
|
||||
/******************************** WARNING ********************************/
|
||||
|
||||
/**
|
||||
* Retrieve the library version.
|
||||
*
|
||||
* The library version is the same format as the full LVM version.
|
||||
* The format is as follows:
|
||||
* LVM_MAJOR.LVM_MINOR.LVM_PATCHLEVEL(LVM_LIBAPI)[-LVM_RELEASE]
|
||||
* An application wishing to determine compatibility with a particular version
|
||||
* of the library should check at least the LVM_MAJOR, LVM_MINOR, and
|
||||
* LVM_LIBAPI numbers. For example, assume the full LVM version is
|
||||
* 2.02.50(1)-1. The application should verify the "2.02" and the "(1)".
|
||||
*
|
||||
* \return A string describing the library version.
|
||||
*/
|
||||
const char *lvm_library_get_version(void);
|
||||
|
||||
/******************************** structures ********************************/
|
||||
|
||||
|
@ -17,6 +17,11 @@
|
||||
#include "toolcontext.h"
|
||||
#include "locking.h"
|
||||
|
||||
const char *lvm_library_get_version(void)
|
||||
{
|
||||
return LVM_VERSION;
|
||||
}
|
||||
|
||||
lvm_t lvm_init(const char *system_dir)
|
||||
{
|
||||
struct cmd_context *cmd;
|
||||
|
@ -607,6 +607,7 @@ int main (int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("Library version: %s\n", lvm_library_get_version());
|
||||
lvmapi_test_shell(libh);
|
||||
|
||||
lvm_quit(libh);
|
||||
|
@ -96,6 +96,7 @@ int main(int argc, char *argv[])
|
||||
goto bad;
|
||||
}
|
||||
|
||||
printf("Library version: %s\n", lvm_library_get_version());
|
||||
vg_create(vg_name);
|
||||
vg_extend(vg, device);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user