2 man/dmsetup.8.in | 7 ++++
3 tools/dmsetup.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 2 files changed, 95 insertions(+)
6 --- LVM2.2.02.149/man/dmsetup.8.in.orig 2016-04-05 22:16:49.848604442 +0200
7 +++ LVM2.2.02.149/man/dmsetup.8.in 2016-04-06 15:59:35.582595117 +0200
22 . RB [ \-c | \-C | \-\-columns ]
24 \fBdevname\fP (map name for device-mapper devices, equal to blkdevname otherwise).
28 +Outputs information in key/value format to be imported by other programs.
32 Outputs a summary of the commands available, optionally including
33 --- LVM2.2.02.130/tools/dmsetup.c.orig 2015-09-09 18:44:39.471523160 +0200
34 +++ LVM2.2.02.130/tools/dmsetup.c 2015-09-09 18:48:33.918179988 +0200
35 @@ -2189,6 +2189,93 @@
39 +static int _export(CMD_ARGS)
42 + struct dm_task *dmt = NULL;
44 + uint64_t start, length;
45 + char *target_type = NULL;
47 + const char *name = NULL;
48 + const char *uuid = NULL;
49 + struct dm_info info;
56 + if (!(dmt = dm_task_create(DM_DEVICE_STATUS)))
59 + if (!_set_task_device(dmt, name, 0))
62 + if (!dm_task_run(dmt))
65 + if (!dm_task_get_info(dmt, &info) || !info.exists)
69 + name = dm_task_get_name(dmt);
71 + uuid = dm_task_get_uuid(dmt);
72 + printf("DM_NAME=%s\n", name);
74 + if ((uuid = dm_task_get_uuid(dmt)) && *uuid)
75 + printf("DM_UUID=%s\n", uuid);
78 + printf("DM_STATE=NOTPRESENT\n");
82 + printf("DM_STATE=%s\n",
83 + info.suspended ? "SUSPENDED" :
84 + (info.read_only ? "READONLY" : "ACTIVE"));
86 + if (!info.live_table && !info.inactive_table)
87 + printf("DM_TABLE_STATE=NONE\n");
89 + printf("DM_TABLE_STATE=%s%s%s\n",
90 + info.live_table ? "LIVE" : "",
91 + info.live_table && info.inactive_table ? "/" : "",
92 + info.inactive_table ? "INACTIVE" : "");
94 + if (info.open_count != -1)
95 + printf("DM_OPENCOUNT=%d\n", info.open_count);
97 + printf("DM_LAST_EVENT_NR=%" PRIu32 "\n", info.event_nr);
99 + printf("DM_MAJOR=%d\n", info.major);
100 + printf("DM_MINOR=%d\n", info.minor);
102 + if (info.target_count != -1)
103 + printf("DM_TARGET_COUNT=%d\n", info.target_count);
105 + /* export all table types */
106 + next = dm_get_next_target(dmt, next, &start, &length,
107 + &target_type, ¶ms);
109 + printf("DM_TARGET_TYPES=%s", target_type);
111 + next = dm_get_next_target(dmt, next, &start, &length,
112 + &target_type, ¶ms);
114 + printf(",%s", target_type);
122 + dm_task_destroy(dmt);
126 /* Show target names and their version numbers */
127 static int _targets(CMD_ARGS)
129 @@ -5139,6 +5226,7 @@
130 {"stats", "<command> [<options>] [<devices>]", 1, -1, 1, 1, _stats},
131 {"status", "[<device>] [--noflush] [--target <target_type>]", 0, -1, 1, 0, _status},
132 {"table", "[<device>] [--target <target_type>] [--showkeys]", 0, -1, 1, 0, _status},
133 + {"export", "[<device>]", 0, 1, 1, 0, _export},
134 {"wait", "<device> [<event_nr>] [--noflush]", 0, 2, 0, 0, _wait},
135 {"mknodes", "[<device>]", 0, -1, 1, 0, _mknodes},
136 {"mangle", "[<device>]", 0, -1, 1, 0, _mangle},