1 diff -dur -x '*~' -x '*.orig' -x '*.rej' LVM2.2.02.98.orig/man/dmsetup.8.in LVM2.2.02.98/man/dmsetup.8.in
2 --- LVM2.2.02.98.orig/man/dmsetup.8.in 2012-10-15 16:24:58.000000000 +0200
3 +++ LVM2.2.02.98/man/dmsetup.8.in 2012-10-25 10:24:13.000000000 +0200
15 See below for information on the table format.
21 +Outputs information in key/value format to be imported by other programs.
27 diff -dur -x '*~' -x '*.orig' -x '*.rej' LVM2.2.02.98.orig/tools/dmsetup.c LVM2.2.02.98/tools/dmsetup.c
28 --- LVM2.2.02.98.orig/tools/dmsetup.c 2012-10-25 10:23:32.000000000 +0200
29 +++ LVM2.2.02.98/tools/dmsetup.c 2012-10-25 10:24:35.000000000 +0200
30 @@ -1725,6 +1725,94 @@
34 +static int _export(int argc, char **argv, void *data)
37 + struct dm_task *dmt = NULL;
39 + uint64_t start, length;
40 + char *target_type = NULL;
42 + struct dm_names *names = (struct dm_names *) data;
43 + const char *name = NULL;
44 + const char *uuid = NULL;
45 + struct dm_info info;
52 + if (!(dmt = dm_task_create(DM_DEVICE_STATUS)))
55 + if (!_set_task_device(dmt, name, 0))
58 + if (!dm_task_run(dmt))
61 + if (!dm_task_get_info(dmt, &info) || !info.exists)
65 + name = dm_task_get_name(dmt);
67 + uuid = dm_task_get_uuid(dmt);
68 + printf("DM_NAME=%s\n", name);
70 + if ((uuid = dm_task_get_uuid(dmt)) && *uuid)
71 + printf("DM_UUID=%s\n", uuid);
74 + printf("DM_STATE=NOTPRESENT\n");
78 + printf("DM_STATE=%s\n",
79 + info.suspended ? "SUSPENDED" :
80 + (info.read_only ? " READONLY" : "ACTIVE"));
82 + if (!info.live_table && !info.inactive_table)
83 + printf("DM_TABLE_STATE=NONE\n");
85 + printf("DM_TABLE_STATE=%s%s%s\n",
86 + info.live_table ? "LIVE" : "",
87 + info.live_table && info.inactive_table ? "/" : "",
88 + info.inactive_table ? "INACTIVE" : "");
90 + if (info.open_count != -1)
91 + printf("DM_OPENCOUNT=%d\n", info.open_count);
93 + printf("DM_LAST_EVENT_NR=%" PRIu32 "\n", info.event_nr);
95 + printf("DM_MAJOR=%d\n", info.major);
96 + printf("DM_MINOR=%d\n", info.minor);
98 + if (info.target_count != -1)
99 + printf("DM_TARGET_COUNT=%d\n", info.target_count);
101 + /* export all table types */
102 + next = dm_get_next_target(dmt, next, &start, &length,
103 + &target_type, ¶ms);
105 + printf("DM_TARGET_TYPES=%s", target_type);
107 + next = dm_get_next_target(dmt, next, &start, &length,
108 + &target_type, ¶ms);
110 + printf(",%s", target_type);
118 + dm_task_destroy(dmt);
122 /* Show target names and their version numbers */
123 static int _targets(CMD_ARGS)
125 @@ -3075,6 +3163,7 @@
126 {"info", "[<device>]", 0, -1, 1, _info},
127 {"deps", "[-o options] [<device>]", 0, -1, 1, _deps},
128 {"status", "[<device>] [--noflush] [--target <target_type>]", 0, -1, 1, _status},
129 + {"export", "[<device>]", 0, -1, 1, _export},
130 {"table", "[<device>] [--target <target_type>] [--showkeys]", 0, -1, 1, _status},
131 {"wait", "<device> [<event_nr>] [--noflush]", 0, 2, 0, _wait},
132 {"mknodes", "[<device>]", 0, -1, 1, _mknodes},