1
0
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:
Alasdair Kergon 2002-03-13 16:19:17 +00:00
parent dd420615d5
commit b2de0b7d44
4 changed files with 14 additions and 0 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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: