44
42
+ printf("DM_NAME=\"%s\"\n", dm_task_get_name(dmt));
46
44
+ printf("DM_STATE=%s\n", info.suspended ? "SUSPENDED" : "ACTIVE");
47
+ printf("DM_STATE_RO=%s\n", info.read_only ? "READ-ONLY" : "");
45
+ if (!info.suspended)
46
+ printf("DM_STATE_ACTIVE=1\n");
48
+ printf("DM_STATE_READONLY=1\n");
49
+ if (info.live_table)
50
+ printf("DM_TABLE_LIVE=1\n");
51
+ if (info.inactive_table)
52
+ printf("DM_TABLE_INACTIVE=1\n");
49
54
+ printf("DM_LAST_EVENT_NR=%" PRIu32 "\n", info.event_nr);
50
55
+ printf("DM_MAJOR=%d\n", info.major);
51
56
+ printf("DM_MINOR=%d\n", info.minor);
53
+ /* export all table types */
54
58
+ if (info.target_count != -1)
55
+ printf("DM_TARGET_COUNT=%d\n", info.target_count);
57
+ next = dm_get_next_target(dmt, next, &start, &length,
58
+ &target_type, ¶ms);
60
+ printf("DM_TARGET_TYPES=%s", target_type);
62
+ next = dm_get_next_target(dmt, next, &start, &length,
63
+ &target_type, ¶ms);
65
+ printf(",%s", target_type);
70
+ if (!(uuid = dm_task_get_uuid(dmt)))
72
+ printf("DM_UUID=\"%s\"\n", uuid);
59
+ printf("DM_TARGET_COUNT=%d\n", info.target_count);
61
+ next = dm_get_next_target(dmt, next, &start, &length, &target_type, ¶ms);
63
+ printf("DM_TARGET_TYPES=%s", target_type);
65
+ next = dm_get_next_target(dmt, next, &start, &length,
66
+ &target_type, ¶ms);
68
+ printf(",%s", target_type);
73
+ if ((uuid = dm_task_get_uuid(dmt)) && *uuid)
74
+ printf("DM_UUID=\"%s\"\n", uuid);
81
83
/* Show target names and their version numbers */
82
84
static int _targets(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused)))
85
87
{"targets", "", 0, 0, _targets},
86
88
{"version", "", 0, 0, _version},
87
89
{"setgeometry", "<device> <cyl> <head> <sect> <start>", 5, 5, _setgeometry},