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.
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)
dm_hash_get_data
dm_hash_get_first
dm_hash_get_next
+dm_driver_version
* Use NULL for all devices.
*/
int dm_mknodes(const char *name);
+int dm_driver_version(char *version, size_t size);
/*****************************
* Dependency tree functions *
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;
+}