mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
dmsetup display uuid
This commit is contained in:
parent
dd420615d5
commit
b2de0b7d44
@ -77,6 +77,11 @@ int dm_task_get_info(struct dm_task *dmt, struct dm_info *info)
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *dm_task_get_uuid(struct dm_task *dmt)
|
||||
{
|
||||
return (dmt->dmi->uuid);
|
||||
}
|
||||
|
||||
struct dm_deps *dm_task_get_deps(struct dm_task *dmt)
|
||||
{
|
||||
return (struct dm_deps *) (((void *) dmt->dmi) + dmt->dmi->data_start);
|
||||
|
@ -76,6 +76,7 @@ struct dm_deps {
|
||||
int dm_get_library_version(char *version, size_t size);
|
||||
int dm_task_get_driver_version(struct dm_task *dmt, char *version, size_t size);
|
||||
int dm_task_get_info(struct dm_task *dmt, struct dm_info *dmi);
|
||||
const char *dm_task_get_uuid(struct dm_task *dmt);
|
||||
|
||||
struct dm_deps *dm_task_get_deps(struct dm_task *dmt);
|
||||
|
||||
|
@ -111,6 +111,8 @@ int dm_task_set_name(struct dm_task *dmt, const char *name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
log_very_verbose("Setting name: %s", dmt->dev_name);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -126,6 +128,8 @@ int dm_task_set_uuid(struct dm_task *dmt, const char *uuid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
log_very_verbose("Setting uuid: %s", dmt->uuid);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -230,6 +230,7 @@ static int _resume(int argc, char **argv)
|
||||
static int _info(int argc, char **argv)
|
||||
{
|
||||
int r = 0;
|
||||
char *uuid;
|
||||
|
||||
/* remove <dev_name> */
|
||||
struct dm_task *dmt;
|
||||
@ -264,6 +265,9 @@ static int _info(int argc, char **argv)
|
||||
if (info.target_count != -1)
|
||||
printf("Number of targets: %d\n", info.target_count);
|
||||
|
||||
if ((uuid = dm_task_get_uuid(dmt)) && *uuid)
|
||||
printf("UUID: %s\n", uuid);
|
||||
|
||||
r = 1;
|
||||
|
||||
out:
|
||||
|
Loading…
Reference in New Issue
Block a user