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:
parent
f894b4b1b7
commit
ffc88f2eeb
@ -1,5 +1,6 @@
|
|||||||
Version 1.02.00 -
|
Version 1.02.00 -
|
||||||
=============================
|
=============================
|
||||||
|
Add dm_driver_version().
|
||||||
Added dependency tree functions to library.
|
Added dependency tree functions to library.
|
||||||
Added hash, bitset, pool, dbg_malloc to library.
|
Added hash, bitset, pool, dbg_malloc to library.
|
||||||
Added ls --tree to dmsetup.
|
Added ls --tree to dmsetup.
|
||||||
|
@ -81,3 +81,4 @@ dm_hash_get_key
|
|||||||
dm_hash_get_data
|
dm_hash_get_data
|
||||||
dm_hash_get_first
|
dm_hash_get_first
|
||||||
dm_hash_get_next
|
dm_hash_get_next
|
||||||
|
dm_driver_version
|
||||||
|
@ -188,6 +188,7 @@ void dm_lib_exit(void) __attribute((destructor));
|
|||||||
* Use NULL for all devices.
|
* Use NULL for all devices.
|
||||||
*/
|
*/
|
||||||
int dm_mknodes(const char *name);
|
int dm_mknodes(const char *name);
|
||||||
|
int dm_driver_version(char *version, size_t size);
|
||||||
|
|
||||||
/*****************************
|
/*****************************
|
||||||
* Dependency tree functions *
|
* Dependency tree functions *
|
||||||
|
@ -469,3 +469,24 @@ out:
|
|||||||
dm_task_destroy(dmt);
|
dm_task_destroy(dmt);
|
||||||
return r;
|
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;
|
||||||
|
}
|
||||||
|
@ -497,32 +497,17 @@ static int _message(int argc, char **argv, void *data)
|
|||||||
|
|
||||||
static int _version(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];
|
char version[80];
|
||||||
|
|
||||||
if (dm_get_library_version(version, sizeof(version)))
|
if (dm_get_library_version(version, sizeof(version)))
|
||||||
printf("Library version: %s\n", version);
|
printf("Library version: %s\n", version);
|
||||||
|
|
||||||
if (!(dmt = dm_task_create(DM_DEVICE_VERSION)))
|
if (dm_driver_version(version, sizeof(version)))
|
||||||
return 0;
|
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);
|
printf("Driver version: %s\n", version);
|
||||||
|
|
||||||
r = 1;
|
return 1;
|
||||||
|
|
||||||
out:
|
|
||||||
dm_task_destroy(dmt);
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _simple(int task, const char *name, uint32_t event_nr, int display)
|
static int _simple(int task, const char *name, uint32_t event_nr, int display)
|
||||||
|
Loading…
Reference in New Issue
Block a user