1 diff -urp LVM2.2.02.177.orig/man/dmsetup.8_main LVM2.2.02.177/man/dmsetup.8_main
2 --- LVM2.2.02.177.orig/man/dmsetup.8_main 2017-12-18 20:44:35.000000000 +0000
3 +++ LVM2.2.02.177/man/dmsetup.8_main 2018-01-26 15:24:01.378500379 +0000
4 @@ -59,6 +59,14 @@ dmsetup \(em low level logical volume ma
18 . RB [ -c | -C | --columns ]
19 @@ -651,6 +659,9 @@ device. Device names on output can be cu
20 \fBdevname\fP (map name for device-mapper devices, equal to blkdevname otherwise).
24 +Outputs information in key/value format to be imported by other programs.
28 Outputs a summary of the commands available, optionally including
29 diff -urp LVM2.2.02.177.orig/tools/dmsetup.c LVM2.2.02.177/tools/dmsetup.c
30 --- LVM2.2.02.177.orig/tools/dmsetup.c 2018-01-26 15:13:17.000000000 +0000
31 +++ LVM2.2.02.177/tools/dmsetup.c 2018-01-26 15:22:40.528505198 +0000
32 @@ -2572,6 +2572,93 @@ out:
36 +static int _export(CMD_ARGS)
39 + struct dm_task *dmt = NULL;
41 + uint64_t start, length;
42 + char *target_type = NULL;
44 + const char *name = NULL;
45 + const char *uuid = NULL;
46 + struct dm_info info;
53 + if (!(dmt = dm_task_create(DM_DEVICE_STATUS)))
56 + if (!_set_task_device(dmt, name, 0))
59 + if (!dm_task_run(dmt))
62 + if (!dm_task_get_info(dmt, &info) || !info.exists)
66 + name = dm_task_get_name(dmt);
68 + uuid = dm_task_get_uuid(dmt);
69 + printf("DM_NAME=%s\n", name);
71 + if ((uuid = dm_task_get_uuid(dmt)) && *uuid)
72 + printf("DM_UUID=%s\n", uuid);
75 + printf("DM_STATE=NOTPRESENT\n");
79 + printf("DM_STATE=%s\n",
80 + info.suspended ? "SUSPENDED" :
81 + (info.read_only ? "READONLY" : "ACTIVE"));
83 + if (!info.live_table && !info.inactive_table)
84 + printf("DM_TABLE_STATE=NONE\n");
86 + printf("DM_TABLE_STATE=%s%s%s\n",
87 + info.live_table ? "LIVE" : "",
88 + info.live_table && info.inactive_table ? "/" : "",
89 + info.inactive_table ? "INACTIVE" : "");
91 + if (info.open_count != -1)
92 + printf("DM_OPENCOUNT=%d\n", info.open_count);
94 + printf("DM_LAST_EVENT_NR=%" PRIu32 "\n", info.event_nr);
96 + printf("DM_MAJOR=%d\n", info.major);
97 + printf("DM_MINOR=%d\n", info.minor);
99 + if (info.target_count != -1)
100 + printf("DM_TARGET_COUNT=%d\n", info.target_count);
102 + /* export all table types */
103 + next = dm_get_next_target(dmt, next, &start, &length,
104 + &target_type, ¶ms);
106 + printf("DM_TARGET_TYPES=%s", target_type);
108 + next = dm_get_next_target(dmt, next, &start, &length,
109 + &target_type, ¶ms);
111 + printf(",%s", target_type);
119 + dm_task_destroy(dmt);
123 /* Show target names and their version numbers */
124 static int _targets(CMD_ARGS)
126 @@ -6247,6 +6334,7 @@ static struct command _dmsetup_commands[
127 {"stats", "<command> [<options>] [<device>...]", 1, -1, 1, 1, _stats},
128 {"status", "[<device>...] [--noflush] [--target <target_type>]", 0, -1, 2, 0, _status},
129 {"table", "[<device>...] [--concise] [--target <target_type>] [--showkeys]", 0, -1, 2, 0, _status},
130 + {"export", "[<device>]", 0, 1, 1, 0, _export},
131 {"wait", "<device> [<event_nr>] [--noflush]", 0, 2, 0, 0, _wait},
132 {"mknodes", "[<device>...]", 0, -1, 1, 0, _mknodes},
133 {"mangle", "[<device>...]", 0, -1, 1, 0, _mangle},