1 diff -ur LVM2.2.03.02.orig/libdm/dm-tools/dmsetup.c LVM2.2.03.02/libdm/dm-tools/dmsetup.c
2 --- LVM2.2.03.02.orig/libdm/dm-tools/dmsetup.c 2019-03-22 16:55:55.393000000 +0100
3 +++ LVM2.2.03.02/libdm/dm-tools/dmsetup.c 2019-03-22 17:00:55.046000000 +0100
8 +static int _export(CMD_ARGS)
11 + struct dm_task *dmt = NULL;
13 + uint64_t start, length;
14 + char *target_type = NULL;
16 + const char *name = NULL;
17 + const char *uuid = NULL;
18 + struct dm_info info;
25 + if (!(dmt = dm_task_create(DM_DEVICE_STATUS)))
28 + if (!_set_task_device(dmt, name, 0))
31 + if (!dm_task_run(dmt))
34 + if (!dm_task_get_info(dmt, &info) || !info.exists)
38 + name = dm_task_get_name(dmt);
40 + uuid = dm_task_get_uuid(dmt);
41 + printf("DM_NAME=%s\n", name);
43 + if ((uuid = dm_task_get_uuid(dmt)) && *uuid)
44 + printf("DM_UUID=%s\n", uuid);
47 + printf("DM_STATE=NOTPRESENT\n");
51 + printf("DM_STATE=%s\n",
52 + info.suspended ? "SUSPENDED" :
53 + (info.read_only ? "READONLY" : "ACTIVE"));
55 + if (!info.live_table && !info.inactive_table)
56 + printf("DM_TABLE_STATE=NONE\n");
58 + printf("DM_TABLE_STATE=%s%s%s\n",
59 + info.live_table ? "LIVE" : "",
60 + info.live_table && info.inactive_table ? "/" : "",
61 + info.inactive_table ? "INACTIVE" : "");
63 + if (info.open_count != -1)
64 + printf("DM_OPENCOUNT=%d\n", info.open_count);
66 + printf("DM_LAST_EVENT_NR=%" PRIu32 "\n", info.event_nr);
68 + printf("DM_MAJOR=%d\n", info.major);
69 + printf("DM_MINOR=%d\n", info.minor);
71 + if (info.target_count != -1)
72 + printf("DM_TARGET_COUNT=%d\n", info.target_count);
74 + /* export all table types */
75 + next = dm_get_next_target(dmt, next, &start, &length,
76 + &target_type, ¶ms);
78 + printf("DM_TARGET_TYPES=%s", target_type);
80 + next = dm_get_next_target(dmt, next, &start, &length,
81 + &target_type, ¶ms);
83 + printf(",%s", target_type);
91 + dm_task_destroy(dmt);
95 /* Show target names and their version numbers */
96 static int _targets(CMD_ARGS)
99 {"stats", "<command> [<options>] [<device>...]", 1, -1, 1, 1, _stats},
100 {"status", "[<device>...] [--noflush] [--target <target_type>]", 0, -1, 2, 0, _status},
101 {"table", "[<device>...] [--concise] [--target <target_type>] [--showkeys]", 0, -1, 2, 0, _status},
102 + {"export", "[<device>]", 0, 1, 1, 0, _export},
103 {"wait", "<device> [<event_nr>] [--noflush]", 0, 2, 0, 0, _wait},
104 {"mknodes", "[<device>...]", 0, -1, 1, 0, _mknodes},
105 {"mangle", "[<device>...]", 0, -1, 1, 0, _mangle},
106 diff -ur LVM2.2.03.02.orig/man/dmsetup.8_main LVM2.2.03.02/man/dmsetup.8_main
107 --- LVM2.2.03.02.orig/man/dmsetup.8_main 2019-03-22 16:55:55.394000000 +0100
108 +++ LVM2.2.03.02/man/dmsetup.8_main 2019-03-22 17:00:55.047000000 +0100
115 +. RI [ device_name ]
123 . RB [ -c | -C | --columns ]
125 \fBdevname\fP (map name for device-mapper devices, equal to blkdevname otherwise).
129 +Outputs information in key/value format to be imported by other programs.
133 Outputs a summary of the commands available, optionally including