Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-fs/lvm2/files: lvm.conf-2.02.56.patch lvm2-2.02.56-dmeventd.patch lvm2-2.02.56-device-mapper-export-format.patch
Date: Mon, 30 Nov 2009 00:33:16
Message-Id: E1NEuCX-0004PE-UT@stork.gentoo.org
1 robbat2 09/11/30 00:33:13
2
3 Added: lvm.conf-2.02.56.patch lvm2-2.02.56-dmeventd.patch
4 lvm2-2.02.56-device-mapper-export-format.patch
5 Log:
6 Bug #294983: version bump.
7 (Portage version: 2.2_rc51/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sys-fs/lvm2/files/lvm.conf-2.02.56.patch
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/lvm2/files/lvm.conf-2.02.56.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/lvm2/files/lvm.conf-2.02.56.patch?rev=1.1&content-type=text/plain
14
15 Index: lvm.conf-2.02.56.patch
16 ===================================================================
17 diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.56.orig/doc/example.conf LVM2.2.02.56/doc/example.conf
18 --- LVM2.2.02.56.orig/doc/example.conf 2009-10-05 12:44:21.000000000 +0000
19 +++ LVM2.2.02.56/doc/example.conf 2009-11-29 23:53:00.123882589 +0000
20 @@ -50,7 +50,9 @@
21
22
23 # By default we accept every block device:
24 - filter = [ "a/.*/" ]
25 + # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
26 + # noise when you probed while not available.
27 + filter = [ "r|/dev/nbd.*|", "a/.*/" ]
28
29 # Exclude the cdrom drive
30 # filter = [ "r|/dev/cdrom|" ]
31 @@ -259,6 +261,8 @@
32 # the new lvm2 on-disk metadata format.
33 # The default value is set when the tools are built.
34 # fallback_to_lvm1 = 0
35 + # Gentoo: the LVM tools are a seperate package.
36 + fallback_to_lvm1 = 0
37
38 # The default metadata format that commands should use - "lvm1" or "lvm2".
39 # The command line override is -M1 or -M2.
40 @@ -411,12 +415,12 @@
41
42 # Metadata settings
43 #
44 -# metadata {
45 +metadata {
46 # Default number of copies of metadata to hold on each PV. 0, 1 or 2.
47 # You might want to override it from the command line with 0
48 # when running pvcreate on new PVs which are to be added to large VGs.
49 -
50 - # pvmetadatacopies = 1
51 + # Gentoo: enable for data safety, but PV resize is then disabled.
52 + #pvmetadatacopies = 2
53
54 # Approximate default size of on-disk metadata areas in sectors.
55 # You should increase this if you have large volume groups or
56 @@ -438,7 +442,7 @@
57 # the supplied toolset to make changes (e.g. vgcfgrestore).
58
59 # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
60 -#}
61 +}
62
63 # Event daemon
64 #
65
66
67
68 1.1 sys-fs/lvm2/files/lvm2-2.02.56-dmeventd.patch
69
70 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/lvm2/files/lvm2-2.02.56-dmeventd.patch?rev=1.1&view=markup
71 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/lvm2/files/lvm2-2.02.56-dmeventd.patch?rev=1.1&content-type=text/plain
72
73 Index: lvm2-2.02.56-dmeventd.patch
74 ===================================================================
75 diff -Nuar LVM2.2.02.56.orig/daemons/dmeventd/Makefile.in LVM2.2.02.56/daemons/dmeventd/Makefile.in
76 --- LVM2.2.02.56.orig/daemons/dmeventd/Makefile.in 2009-11-13 12:48:01.000000000 +0000
77 +++ LVM2.2.02.56/daemons/dmeventd/Makefile.in 2009-11-29 23:50:22.873898621 +0000
78 @@ -60,7 +60,7 @@
79 $(RM) -f $@
80 $(LN_S) $(LIB_SHARED) $@
81
82 -dmeventd: $(LIB_SHARED) $(VERSIONED_SHLIB) dmeventd.o
83 +dmeventd: $(LIB_SHARED) $(LIB_STATIC) $(VERSIONED_SHLIB) dmeventd.o
84 $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ dmeventd.o \
85 $(LVMLIBS) $(LIBS) -rdynamic
86
87
88
89
90 1.1 sys-fs/lvm2/files/lvm2-2.02.56-device-mapper-export-format.patch
91
92 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/lvm2/files/lvm2-2.02.56-device-mapper-export-format.patch?rev=1.1&view=markup
93 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/lvm2/files/lvm2-2.02.56-device-mapper-export-format.patch?rev=1.1&content-type=text/plain
94
95 Index: lvm2-2.02.56-device-mapper-export-format.patch
96 ===================================================================
97 diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.56.orig/libdm/libdevmapper.h LVM2.2.02.56/libdm/libdevmapper.h
98 --- LVM2.2.02.56.orig/libdm/libdevmapper.h 2009-11-13 12:43:21.000000000 +0000
99 +++ LVM2.2.02.56/libdm/libdevmapper.h 2009-11-29 23:56:16.410529643 +0000
100 @@ -982,6 +982,7 @@
101 #define DM_REPORT_OUTPUT_FIELD_NAME_PREFIX 0x00000008
102 #define DM_REPORT_OUTPUT_FIELD_UNQUOTED 0x00000010
103 #define DM_REPORT_OUTPUT_COLUMNS_AS_ROWS 0x00000020
104 +#define DM_REPORT_OUTPUT_EXPORT 0x00000040
105
106 struct dm_report *dm_report_init(uint32_t *report_types,
107 const struct dm_report_object_type *types,
108 diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.56.orig/libdm/libdm-report.c LVM2.2.02.56/libdm/libdm-report.c
109 --- LVM2.2.02.56.orig/libdm/libdm-report.c 2009-02-09 09:45:49.000000000 +0000
110 +++ LVM2.2.02.56/libdm/libdm-report.c 2009-11-29 23:56:16.410529643 +0000
111 @@ -891,6 +891,8 @@
112 uint32_t align;
113 const char *repstr;
114 char buf[4096];
115 + const char *fname;
116 + char tmp_char;
117
118 if (rh->flags & DM_REPORT_OUTPUT_FIELD_NAME_PREFIX) {
119 if (!(field_id = strdup(rh->fields[field->props->field_num].id))) {
120 @@ -921,6 +923,25 @@
121 return 0;
122 }
123 }
124 + if (rh->flags & DM_REPORT_OUTPUT_EXPORT) {
125 + fname = rh->fields[field->props->field_num].id;
126 + if (!dm_pool_grow_object(rh->mem, "DM_", strlen("DM_"))) {
127 + log_error("dm_report: Unable to extend output line");
128 + return 0;
129 + }
130 + while (fname && fname[0]) {
131 + tmp_char = toupper(fname[0]);
132 + if (!dm_pool_grow_object(rh->mem, &tmp_char, 1)) {
133 + log_error("dm_report: Unable to extend output line");
134 + return 0;
135 + }
136 + fname++;
137 + }
138 + if (!dm_pool_grow_object(rh->mem, "=", strlen("="))) {
139 + log_error("dm_report: Unable to extend output line");
140 + return 0;
141 + }
142 + }
143
144 repstr = field->report_string;
145 width = field->props->width;
146 diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.56.orig/tools/dmsetup.c LVM2.2.02.56/tools/dmsetup.c
147 --- LVM2.2.02.56.orig/tools/dmsetup.c 2009-11-13 12:43:22.000000000 +0000
148 +++ LVM2.2.02.56/tools/dmsetup.c 2009-11-29 23:59:32.047603270 +0000
149 @@ -114,6 +114,7 @@
150 enum {
151 READ_ONLY = 0,
152 COLS_ARG,
153 + EXPORT_ARG,
154 EXEC_ARG,
155 FORCE_ARG,
156 GID_ARG,
157 @@ -152,7 +153,8 @@
158 DR_INFO = 2,
159 DR_DEPS = 4,
160 DR_TREE = 8, /* Complete dependency tree required */
161 - DR_NAME = 16
162 + DR_NAME = 16,
163 + DR_TABLE = 0x20, /* table is required, not just info */
164 } report_type_t;
165
166 static int _switches[NUM_SWITCHES];
167 @@ -1491,8 +1493,13 @@
168 name = argv[1];
169 }
170
171 - if (!(dmt = dm_task_create(DM_DEVICE_INFO)))
172 - return 0;
173 + if (_report_type & DR_TABLE ) {
174 + if (!(dmt = dm_task_create(DM_DEVICE_TABLE)))
175 + return 0;
176 + } else {
177 + if (!(dmt = dm_task_create(DM_DEVICE_INFO)))
178 + return 0;
179 + }
180
181 if (!_set_task_device(dmt, name, 0))
182 goto out;
183 @@ -1962,6 +1969,16 @@
184 return dm_report_field_uint32(rh, field, &value);
185 }
186
187 +static int _int_disp(struct dm_report *rh,
188 + struct dm_pool *mem __attribute((unused)),
189 + struct dm_report_field *field, const void *data,
190 + void *private __attribute((unused)))
191 +{
192 + const int value = *(const int *)data;
193 +
194 + return dm_report_field_int(rh, field, &value);
195 +}
196 +
197 static int _dm_name_disp(struct dm_report *rh,
198 struct dm_pool *mem __attribute((unused)),
199 struct dm_report_field *field, const void *data,
200 @@ -2073,6 +2090,66 @@
201 }
202
203
204 +static int _dm_info_cleartext_status_disp(struct dm_report *rh,
205 + struct dm_pool *mem __attribute((unused)),
206 + struct dm_report_field *field, const void *data,
207 + void *private __attribute((unused)))
208 +{
209 + const char *buf = "NOTPRESENT";
210 + const struct dm_info *info = data;
211 +
212 + if (info->exists) {
213 + if (info->suspended)
214 + buf = "SUSPENDED";
215 + else
216 + buf = info->read_only ? " READONLY" : "ACTIVE";
217 + }
218 +
219 + return dm_report_field_string(rh, field, &buf);
220 +}
221 +
222 +static int _dm_info_target_types_disp(struct dm_report *rh,
223 + struct dm_pool *mem __attribute((unused)),
224 + struct dm_report_field *field, const void *data,
225 + void *private __attribute((unused)))
226 +{
227 + char buf[1024];
228 + char *dest = buf;
229 + int remains = sizeof(buf);
230 + int written;
231 + const char *s = buf;
232 + struct dm_task *dmt = (struct dm_task *) data;
233 + void *next = NULL;
234 + uint64_t start, length;
235 + char *target_type = NULL;
236 + char *params;
237 +
238 +
239 + buf[0] = '\0';
240 +
241 + next = dm_get_next_target(dmt, next, &start, &length,
242 + &target_type, &params);
243 + if (target_type) {
244 + written = snprintf(dest, remains, "%s", target_type);
245 + dest += written;
246 + remains -= written;
247 +
248 + while (remains > 0 && next) {
249 + next = dm_get_next_target(dmt, next, &start, &length,
250 + &target_type, &params);
251 + if (target_type) {
252 + written = snprintf(dest, remains, ",%s", target_type);
253 + dest += written;
254 + remains -= written;
255 + }
256 + }
257 + }
258 +
259 + buf[sizeof(buf)-1] = '\0';
260 +
261 + return dm_report_field_string(rh, field, &s);
262 +}
263 +
264 static int _dm_info_devno_disp(struct dm_report *rh, struct dm_pool *mem,
265 struct dm_report_field *field, const void *data,
266 void *private)
267 @@ -2337,6 +2414,7 @@
268 { DR_DEPS, "Mapped Device Relationship Information", "", _deps_get_obj },
269 { DR_TREE, "Mapped Device Relationship Information", "", _tree_get_obj },
270 { DR_NAME, "Mapped Device Name Components", "", _split_name_get_obj },
271 + { DR_TABLE, "Mapped Device Table", "", _task_get_obj },
272 { 0, "", "", NULL },
273 };
274
275 @@ -2356,6 +2434,7 @@
276 FIELD_F(TASK, NUM, "RAhead", 6, dm_read_ahead, "read_ahead", "Read ahead in sectors.")
277
278 FIELD_F(INFO, STR, "Stat", 4, dm_info_status, "attr", "(L)ive, (I)nactive, (s)uspended, (r)ead-only, read-(w)rite.")
279 +FIELD_F(INFO, STR, "State", 1, dm_info_cleartext_status, "status", "State as cleartext.")
280 FIELD_F(INFO, STR, "Tables", 6, dm_info_table_loaded, "tables_loaded", "Which of the live and inactive table slots are filled.")
281 FIELD_F(INFO, STR, "Suspended", 9, dm_info_suspended, "suspended", "Whether the device is suspended.")
282 FIELD_F(INFO, STR, "Read-only", 9, dm_info_read_only, "readonly", "Whether the device is read-only or writeable.")
283 @@ -2366,6 +2445,11 @@
284 FIELD_O(INFO, dm_info, NUM, "Targ", target_count, 4, int32, "segments", "Number of segments in live table, if present.")
285 FIELD_O(INFO, dm_info, NUM, "Event", event_nr, 6, uint32, "events", "Number of most recent event.")
286
287 +FIELD_O(INFO, dm_info, NUM, "RO", read_only, 2, int, "read_only", "Read only.")
288 +FIELD_O(INFO, dm_info, NUM, "Ex", exists, 2, int, "exists", "Exists.")
289 +FIELD_O(INFO, dm_info, NUM, "Susp", suspended, 4, int, "suspended", "Suspended.")
290 +FIELD_O(INFO, dm_info, NUM, "tab_live", live_table, 8, int, "table_live", "Live table.")
291 +FIELD_O(INFO, dm_info, NUM, "tab_inact", inactive_table, 9, int, "table_inactive", "Inactive table.")
292 FIELD_O(DEPS, dm_deps, NUM, "#Devs", count, 5, int32, "device_count", "Number of devices used by this one.")
293 FIELD_F(TREE, STR, "DevNames", 8, dm_deps_names, "devs_used", "List of names of mapped devices used by this one.")
294 FIELD_F(DEPS, STR, "DevNos", 6, dm_deps, "devnos_used", "List of device numbers of devices used by this one.")
295 @@ -2373,6 +2457,7 @@
296 FIELD_F(TREE, NUM, "#Refs", 5, dm_tree_parents_count, "device_ref_count", "Number of mapped devices referencing this one.")
297 FIELD_F(TREE, STR, "RefNames", 8, dm_tree_parents_names, "names_using_dev", "List of names of mapped devices using this one.")
298 FIELD_F(TREE, STR, "RefDevNos", 9, dm_tree_parents_devs, "devnos_using_dev", "List of device numbers of mapped devices using this one.")
299 +FIELD_F(TABLE, STR, "Targettypes", 32, dm_info_target_types, "target_types", "Used target types.")
300
301 FIELD_O(NAME, dm_split_name, STR, "Subsys", subsystem, 6, dm_subsystem, "subsystem", "Userspace subsystem responsible for this device.")
302 FIELD_O(NAME, dm_split_name, STR, "VG", vg_name, 4, dm_vg_name, "vg_name", "LVM Volume Group name.")
303 @@ -2389,14 +2474,16 @@
304 #undef FIELD_F
305
306 static const char *default_report_options = "name,major,minor,attr,open,segments,events,uuid";
307 +static const char *default_export_options = "name,major,minor,status,read_only,exists,suspended,table_live,table_inactive,open,segments,events,uuid,target_types";
308 static const char *splitname_report_options = "vg_name,lv_name,lv_layer";
309
310 static int _report_init(struct command *c)
311 {
312 - char *options = (char *) default_report_options;
313 + char *default_options = (char *) default_report_options;
314 + char *options;
315 const char *keys = "";
316 const char *separator = " ";
317 - int aligned = 1, headings = 1, buffered = 1, field_prefixes = 0;
318 + int aligned = 1, headings = 1, buffered = 1, field_prefixes = 0, export = 0;
319 int quoted = 1, columns_as_rows = 0;
320 uint32_t flags = 0;
321 size_t len = 0;
322 @@ -2426,6 +2513,15 @@
323 field_prefixes = 1;
324 }
325
326 + if (_switches[EXPORT_ARG]) {
327 + default_options = (char *) default_export_options;
328 + separator = "\n";
329 + aligned = 0;
330 + headings = 0;
331 + export = 1;
332 + }
333 +
334 + options = default_options;
335 if (_switches[OPTIONS_ARG] && _string_args[OPTIONS_ARG]) {
336 if (*_string_args[OPTIONS_ARG] != '+')
337 options = _string_args[OPTIONS_ARG];
338 @@ -2477,6 +2573,9 @@
339 if (columns_as_rows)
340 flags |= DM_REPORT_OUTPUT_COLUMNS_AS_ROWS;
341
342 + if (export)
343 + flags |= DM_REPORT_OUTPUT_EXPORT;
344 +
345 if (!(_report = dm_report_init(&_report_type,
346 _report_types, _report_fields,
347 options, separator, flags, keys, NULL)))
348 @@ -2561,7 +2660,9 @@
349 " [-r|--readonly] [--noopencount] [--nolockfs] [--inactive]\n"
350 " [--noudevsync] [-y|--yes] [--readahead [+]<sectors>|auto|none]\n"
351 " [-c|-C|--columns] [-o <fields>] [-O|--sort <sort_fields>]\n"
352 - " [--nameprefixes] [--noheadings] [--separator <separator>]\n\n");
353 + " [--nameprefixes] [--noheadings] [--separator <separator>]\n"
354 + " [-e|--export]\n"
355 + "\n");
356 for (i = 0; _commands[i].name; i++)
357 fprintf(out, "\t%s %s\n", _commands[i].name, _commands[i].help);
358 fprintf(out, "\n<device> may be device name or -u <uuid> or "
359 @@ -2911,6 +3012,7 @@
360 static struct option long_options[] = {
361 {"readonly", 0, &ind, READ_ONLY},
362 {"columns", 0, &ind, COLS_ARG},
363 + {"export", 0, &ind, EXPORT_ARG},
364 {"exec", 1, &ind, EXEC_ARG},
365 {"force", 0, &ind, FORCE_ARG},
366 {"gid", 1, &ind, GID_ARG},
367 @@ -2996,12 +3098,16 @@
368
369 optarg = 0;
370 optind = OPTIND_INIT;
371 - while ((ind = -1, c = GETOPTLONG_FN(*argc, *argv, "cCfG:j:m:M:no:O:ru:U:vy",
372 + while ((ind = -1, c = GETOPTLONG_FN(*argc, *argv, "cCefG:j:m:M:no:O:ru:U:vy",
373 long_options, NULL)) != -1) {
374 if (c == ':' || c == '?')
375 return 0;
376 if (c == 'c' || c == 'C' || ind == COLS_ARG)
377 _switches[COLS_ARG]++;
378 + if (c == 'e' || ind == EXPORT_ARG) {
379 + _switches[EXPORT_ARG]++;
380 + _switches[COLS_ARG]++;
381 + }
382 if (c == 'f' || ind == FORCE_ARG)
383 _switches[FORCE_ARG]++;
384 if (c == 'r' || ind == READ_ONLY)