1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

dm_driver_version

This commit is contained in:
Alasdair Kergon 2005-10-17 18:05:39 +00:00
parent f894b4b1b7
commit ffc88f2eeb
5 changed files with 26 additions and 17 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.00 -
=============================
Add dm_driver_version().
Added dependency tree functions to library.
Added hash, bitset, pool, dbg_malloc to library.
Added ls --tree to dmsetup.

View File

@ -81,3 +81,4 @@ dm_hash_get_key
dm_hash_get_data
dm_hash_get_first
dm_hash_get_next
dm_driver_version

View File

@ -188,6 +188,7 @@ void dm_lib_exit(void) __attribute((destructor));
* Use NULL for all devices.
*/
int dm_mknodes(const char *name);
int dm_driver_version(char *version, size_t size);
/*****************************
* Dependency tree functions *

View File

@ -469,3 +469,24 @@ out:
dm_task_destroy(dmt);
return r;
}
int dm_driver_version(char *version, size_t size)
{
struct dm_task *dmt;
int r = 0;
if (!(dmt = dm_task_create(DM_DEVICE_VERSION)))
return 0;
if (!dm_task_run(dmt))
log_error("Failed to get driver version");
if (!dm_task_get_driver_version(dmt, version, size))
goto out;
r = 1;
out:
dm_task_destroy(dmt);
return r;
}

View File

@ -497,32 +497,17 @@ static int _message(int argc, char **argv, void *data)
static int _version(int argc, char **argv, void *data)
{
int r = 0;
struct dm_task *dmt;
char version[80];
if (dm_get_library_version(version, sizeof(version)))
printf("Library version: %s\n", version);
if (!(dmt = dm_task_create(DM_DEVICE_VERSION)))
if (dm_driver_version(version, sizeof(version)))
return 0;
if (!dm_task_run(dmt))
goto out;
if (!dm_task_get_driver_version(dmt, (char *) &version,
sizeof(version))) {
goto out;
}
printf("Driver version: %s\n", version);
r = 1;
out:
dm_task_destroy(dmt);
return r;
return 1;
}
static int _simple(int task, const char *name, uint32_t event_nr, int display)