Detail: export MD_UUID from mapfile
[thirdparty/mdadm.git] / Detail.c
CommitLineData
64c4757e 1/*
9a9dab36 2 * mdadm - manage Linux "md" devices aka RAID arrays.
64c4757e 3 *
e736b623 4 * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
64c4757e
NB
5 *
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 * Author: Neil Brown
e736b623 22 * Email: <neilb@suse.de>
64c4757e
NB
23 */
24
9a9dab36 25#include "mdadm.h"
64c4757e
NB
26#include "md_p.h"
27#include "md_u.h"
c69b251b 28#include <dirent.h>
64c4757e 29
54bad364 30int Detail(char *dev, int brief, int export, int test, char *homehost)
64c4757e
NB
31{
32 /*
33 * Print out details for an md array by using
34 * GET_ARRAY_INFO and GET_DISK_INFO ioctl calls
35 */
36
fb97b4d6 37 int fd = open(dev, O_RDONLY);
64c4757e
NB
38 int vers;
39 mdu_array_info_t array;
b0c63f32
NB
40 mdu_disk_info_t *disks;
41 int next;
64c4757e
NB
42 int d;
43 time_t atime;
682c7051 44 char *c;
d013a55e 45 char *devices = NULL;
feb716e9 46 int spares = 0;
dd0781e5 47 struct stat stb;
e5329c37
NB
48 int is_26 = get_linux_version() >= 2006000;
49 int is_rebuilding = 0;
50 int failed = 0;
82d9eba6 51 struct supertype *st = NULL;
e27d562b 52 int max_disks = MD_SB_DISKS; /* just a default */
bed256c2 53 struct mdinfo info;
142cb9e1 54 struct mdinfo *sra;
c69b251b
N
55 char *member = NULL;
56 char *container = NULL;
64c4757e 57
feb716e9 58 int rv = test ? 4 : 1;
a77be586
NB
59 int avail_disks = 0;
60 char *avail;
82b27616 61
64c4757e 62 if (fd < 0) {
682c7051 63 fprintf(stderr, Name ": cannot open %s: %s\n",
64c4757e 64 dev, strerror(errno));
feb716e9 65 return rv;
64c4757e
NB
66 }
67 vers = md_get_version(fd);
68 if (vers < 0) {
682c7051 69 fprintf(stderr, Name ": %s does not appear to be an md device\n",
64c4757e
NB
70 dev);
71 close(fd);
feb716e9 72 return rv;
64c4757e 73 }
682c7051
NB
74 if (vers < 9000) {
75 fprintf(stderr, Name ": cannot get detail for md device %s: driver version too old.\n",
64c4757e
NB
76 dev);
77 close(fd);
feb716e9 78 return rv;
64c4757e
NB
79 }
80 if (ioctl(fd, GET_ARRAY_INFO, &array)<0) {
81 if (errno == ENODEV)
682c7051 82 fprintf(stderr, Name ": md device %s does not appear to be active.\n",
64c4757e
NB
83 dev);
84 else
682c7051 85 fprintf(stderr, Name ": cannot get array detail for %s: %s\n",
64c4757e
NB
86 dev, strerror(errno));
87 close(fd);
feb716e9 88 return rv;
64c4757e 89 }
142cb9e1 90 sra = sysfs_read(fd, 0, GET_VERSION);
1686dc25 91 st = super_by_fd(fd);
f9ce90ba 92
dd0781e5
NB
93 if (fstat(fd, &stb) != 0 && !S_ISBLK(stb.st_mode))
94 stb.st_rdev = 0;
feb716e9 95 rv = 0;
e5329c37 96
c69b251b
N
97 if (st)
98 max_disks = st->max_devs;
99
100 if (sra && is_subarray(sra->text_version) &&
101 strchr(sra->text_version+1, '/')) {
102 /* This is a subarray of some container.
103 * We want the name of the container, and the member
104 */
105 char *s = strchr(sra->text_version+1, '/');
106 int dn;
107 *s++ = '\0';
108 member = s;
109 dn = devname2devnum(sra->text_version+1);
110 container = map_dev(dev2major(dn), dev2minor(dn), 1);
111 }
ea329559 112
e5329c37 113 /* try to load a superblock */
ea329559 114 for (d= 0; d<max_disks; d++) {
e5329c37
NB
115 mdu_disk_info_t disk;
116 char *dv;
117 disk.number = d;
118 if (ioctl(fd, GET_DISK_INFO, &disk) < 0)
119 continue;
120 if (d >= array.raid_disks &&
121 disk.major == 0 &&
122 disk.minor == 0)
123 continue;
16c6fa80 124 if ((dv=map_dev(disk.major, disk.minor, 1))) {
436305c6
DW
125 /* some formats (imsm) have free-floating-spares
126 * with a uuid of uuid_match_any, they don't
127 * have very good info about the rest of the
128 * container, so keep searching when
129 * encountering such a device. Otherwise, stop
130 * after the first successful call to
131 * ->load_super.
132 */
133 int free_spare = memcmp(uuid_match_any,
134 info.uuid,
135 sizeof(uuid_match_any)) == 0;
136 if ((!st || !st->sb || free_spare) &&
ff54de6e
N
137 (array.raid_disks == 0 ||
138 (disk.state & (1<<MD_DISK_ACTIVE)))) {
e5329c37
NB
139 /* try to read the superblock from this device
140 * to get more info
141 */
436305c6
DW
142 if (free_spare)
143 st->ss->free_super(st);
16c6fa80 144 int fd2 = dev_open(dv, O_RDONLY);
82d9eba6 145 if (fd2 >=0 && st &&
3da92f27
NB
146 st->ss->load_super(st, fd2, NULL) == 0) {
147 st->ss->getinfo_super(st, &info);
ff54de6e
N
148 if (array.raid_disks != 0 && /* container */
149 (info.array.ctime != array.ctime ||
150 info.array.level != array.level))
3da92f27 151 st->ss->free_super(st);
4b1ac34b 152 }
e5329c37
NB
153 if (fd2 >= 0) close(fd2);
154 }
155 }
156 }
157
64c4757e 158 /* Ok, we have some info to print... */
682c7051 159 c = map_num(pers, array.level);
54bad364
KS
160
161 if (export) {
c69b251b
N
162 if (array.raid_disks) {
163 if (c)
164 printf("MD_LEVEL=%s\n", c);
165 printf("MD_DEVICES=%d\n", array.raid_disks);
166 } else {
167 printf("MD_LEVEL=container\n");
168 printf("MD_DEVICES=%d\n", array.nr_disks);
169 }
170 if (container) {
171 printf("MD_CONTAINER=%s\n", container);
172 printf("MD_MEMBER=%s\n", member);
173 } else {
174 if (sra && sra->array.major_version < 0)
175 printf("MD_METADATA=%s\n", sra->text_version);
176 else
6c766cf1 177 printf("MD_METADATA=%d.%02d\n",
c69b251b
N
178 array.major_version, array.minor_version);
179 }
35ddc76d
N
180
181 if (st && st->sb) {
182 struct mdinfo info;
183 char nbuf[64];
f069dd29 184 struct map_ent *mp, *map = NULL;
35ddc76d
N
185 st->ss->getinfo_super(st, &info);
186 fname_from_uuid(st, &info, nbuf, ':');
187 printf("MD_UUID=%s\n", nbuf+5);
f069dd29
N
188 mp = map_by_uuid(&map, info.uuid);
189 if (mp && mp->path &&
190 strncmp(mp->path, "/dev/md/", 8) == 0)
191 printf("MD_DEVNAME=%s\n", mp->path+8);
142cb9e1 192
35ddc76d
N
193 if (st->ss->export_detail_super)
194 st->ss->export_detail_super(st);
7e6c6cb2
N
195 } else {
196 struct map_ent *mp, *map = NULL;
aae5a112 197 char nbuf[64];
7e6c6cb2 198 mp = map_by_devnum(&map, fd2devnum(fd));
aae5a112
DW
199 if (mp) {
200 __fname_from_uuid(mp->uuid, 0, nbuf, ':');
201 printf("MD_UUID=%s\n", nbuf+5);
202 }
7e6c6cb2
N
203 if (mp && mp->path &&
204 strncmp(mp->path, "/dev/md/", 8) == 0)
205 printf("MD_DEVNAME=%s\n", mp->path+8);
35ddc76d 206 }
54bad364
KS
207 goto out;
208 }
209
142cb9e1 210 if (brief) {
e8eb8763 211 mdu_bitmap_file_t bmf;
061f2c6a
N
212 printf("ARRAY %s", dev);
213 if (brief > 1) {
214 if (array.raid_disks)
215 printf("level=%s num-devices=%d",
216 c?c:"-unknown-",
217 array.raid_disks );
218 else
219 printf("level=container num-devices=%d",
220 array.nr_disks);
221 }
c69b251b
N
222 if (container) {
223 printf(" container=%s", container);
224 printf(" member=%s", member);
225 } else {
226 if (sra && sra->array.major_version < 0)
227 printf(" metadata=%s", sra->text_version);
228 else
6c766cf1 229 printf(" metadata=%d.%02d",
c69b251b
N
230 array.major_version, array.minor_version);
231 }
e8eb8763
NB
232
233 /* Only try GET_BITMAP_FILE for 0.90.01 and later */
234 if (vers >= 9001 &&
235 ioctl(fd, GET_BITMAP_FILE, &bmf) == 0 &&
236 bmf.pathname[0]) {
237 printf(" bitmap=%s", bmf.pathname);
238 }
142cb9e1 239 } else {
8fac0577 240 mdu_bitmap_file_t bmf;
e0d19036 241 unsigned long long larray_size;
22a88995 242 struct mdstat_ent *ms = mdstat_read(0, 0);
dd0781e5
NB
243 struct mdstat_ent *e;
244 int devnum = array.md_minor;
4ebd3237 245 if (major(stb.st_rdev) == get_mdp_major())
dd0781e5
NB
246 devnum = -1 - devnum;
247
248 for (e=ms; e; e=e->next)
249 if (e->devnum == devnum)
250 break;
beae1dfe
NB
251 if (!get_dev_size(fd, NULL, &larray_size))
252 larray_size = 0;
56eb10c0 253
cd29a5c8 254 printf("%s:\n", dev);
142cb9e1 255
c69b251b
N
256 if (container)
257 printf(" Container : %s, member %s\n", container, member);
258 else {
142cb9e1
NB
259 if (sra && sra->array.major_version < 0)
260 printf(" Version : %s\n", sra->text_version);
261 else
d7ee65c9 262 printf(" Version : %d.%02d\n",
142cb9e1 263 array.major_version, array.minor_version);
c69b251b 264 }
142cb9e1 265
cd29a5c8 266 atime = array.ctime;
c69b251b
N
267 if (atime)
268 printf(" Creation Time : %.24s\n", ctime(&atime));
142cb9e1 269 if (array.raid_disks == 0) c = "container";
cd29a5c8 270 printf(" Raid Level : %s\n", c?c:"-unknown-");
56eb10c0 271 if (larray_size)
dd0781e5 272 printf(" Array Size : %llu%s\n", (larray_size>>10), human_size(larray_size));
3d4064cc
NB
273 if (array.level >= 1) {
274 if (array.major_version != 0 &&
6ee5c05a
NB
275 (larray_size >= 0xFFFFFFFFULL|| array.size == 0)) {
276 unsigned long long dsize = get_component_size(fd);
277 if (dsize > 0)
e3362544 278 printf(" Used Dev Size : %llu%s\n",
a1236192
N
279 dsize/2,
280 human_size((long long)dsize<<9));
6ee5c05a 281 else
e3362544 282 printf(" Used Dev Size : unknown\n");
6ee5c05a 283 } else
e3362544
NB
284 printf(" Used Dev Size : %d%s\n", array.size,
285 human_size((long long)array.size<<10));
3d4064cc 286 }
c69b251b
N
287 if (array.raid_disks)
288 printf(" Raid Devices : %d\n", array.raid_disks);
b83d95f3 289 printf(" Total Devices : %d\n", array.nr_disks);
c69b251b
N
290 if (!container &&
291 ((sra == NULL && array.major_version == 0) ||
292 (sra && sra->array.major_version == 0)))
293 printf("Preferred Minor : %d\n", array.md_minor);
142cb9e1
NB
294 if (sra == NULL || sra->array.major_version >= 0)
295 printf(" Persistence : Superblock is %spersistent\n",
296 array.not_persistent?"not ":"");
cd29a5c8 297 printf("\n");
4027ddca
NB
298 /* Only try GET_BITMAP_FILE for 0.90.01 and later */
299 if (vers >= 9001 &&
300 ioctl(fd, GET_BITMAP_FILE, &bmf) == 0 &&
301 bmf.pathname[0]) {
8fac0577
NB
302 printf(" Intent Bitmap : %s\n", bmf.pathname);
303 printf("\n");
304 } else if (array.state & (1<<MD_SB_BITMAP_PRESENT))
305 printf(" Intent Bitmap : Internal\n\n");
cd29a5c8 306 atime = array.utime;
c69b251b
N
307 if (atime)
308 printf(" Update Time : %.24s\n", ctime(&atime));
309 if (array.raid_disks)
310 printf(" State : %s%s%s%s\n",
311 (array.state&(1<<MD_SB_CLEAN))?"clean":"active",
312 array.active_disks < array.raid_disks? ", degraded":"",
313 (!e || e->percent < 0) ? "" :
314 (e->resync) ? ", resyncing": ", recovering",
315 larray_size ? "": ", Not Started");
316 if (array.raid_disks)
317 printf(" Active Devices : %d\n", array.active_disks);
b83d95f3 318 printf("Working Devices : %d\n", array.working_disks);
c69b251b
N
319 if (array.raid_disks) {
320 printf(" Failed Devices : %d\n", array.failed_disks);
321 printf(" Spare Devices : %d\n", array.spare_disks);
322 }
cd29a5c8
NB
323 printf("\n");
324 if (array.level == 5) {
325 c = map_num(r5layout, array.layout);
326 printf(" Layout : %s\n", c?c:"-unknown-");
327 }
e5329c37 328 if (array.level == 10) {
e4965ef8
N
329 printf(" Layout :");
330 print_r10_layout(array.layout);
331 printf("\n");
e5329c37 332 }
cd29a5c8
NB
333 switch (array.level) {
334 case 0:
335 case 4:
336 case 5:
e5329c37
NB
337 case 10:
338 case 6:
142cb9e1
NB
339 if (array.chunk_size)
340 printf(" Chunk Size : %dK\n\n",
341 array.chunk_size/1024);
cd29a5c8
NB
342 break;
343 case -1:
e5329c37 344 printf(" Rounding : %dK\n\n", array.chunk_size/1024);
cd29a5c8
NB
345 break;
346 default: break;
347 }
aba69144 348
e5329c37 349 if (e && e->percent >= 0) {
bed256c2 350 printf(" Re%s Status : %d%% complete\n",
3da92f27
NB
351 (st && st->sb && info.reshape_active)?
352 "shape":"build",
bed256c2 353 e->percent);
e5329c37
NB
354 is_rebuilding = 1;
355 }
dd0781e5
NB
356 free_mdstat(ms);
357
3da92f27 358 if (st->sb && info.reshape_active) {
bed256c2
NB
359#if 0
360This is pretty boring
361 printf(" Reshape pos'n : %llu%s\n", (unsigned long long) info.reshape_progress<<9,
362 human_size(info.reshape_progress<<9));
363#endif
364 if (info.delta_disks > 0)
365 printf(" Delta Devices : %d, (%d->%d)\n",
366 info.delta_disks, array.raid_disks - info.delta_disks, array.raid_disks);
367 if (info.delta_disks < 0)
368 printf(" Delta Devices : %d, (%d->%d)\n",
369 info.delta_disks, array.raid_disks, array.raid_disks + info.delta_disks);
370 if (info.new_level != array.level) {
371 char *c = map_num(pers, info.new_level);
372 printf(" New Level : %s\n", c?c:"-unknown-");
373 }
374 if (info.new_level != array.level ||
375 info.new_layout != array.layout) {
376 if (info.new_level == 5) {
377 char *c = map_num(r5layout, info.new_layout);
378 printf(" New Layout : %s\n",
379 c?c:"-unknown-");
380 }
381 if (info.new_level == 10) {
b578481c 382 printf(" New Layout : near=%d, %s=%d\n",
bed256c2 383 info.new_layout&255,
b578481c 384 (info.new_layout&0x10000)?"offset":"far",
bed256c2
NB
385 (info.new_layout>>8)&255);
386 }
387 }
388 if (info.new_chunk != array.chunk_size)
389 printf(" New Chunksize : %dK\n", info.new_chunk/1024);
390 printf("\n");
391 } else if (e && e->percent >= 0)
392 printf("\n");
3da92f27
NB
393 if (st && st->sb)
394 st->ss->detail_super(st, homehost);
e5329c37 395
c69b251b
N
396 if (array.raid_disks == 0 && sra && sra->array.major_version == -1
397 && sra->array.minor_version == -2 && sra->text_version[0] != '/') {
398 /* This looks like a container. Find any active arrays
399 * That claim to be a member.
400 */
401 DIR *dir = opendir("/sys/block");
402 struct dirent *de;
403
404 printf(" Member Arrays :");
405
406 while (dir && (de = readdir(dir)) != NULL) {
407 char path[200];
408 char vbuf[1024];
409 int nlen = strlen(sra->sys_name);
410 int dn;
411 if (de->d_name[0] == '.')
412 continue;
413 sprintf(path, "/sys/block/%s/md/metadata_version",
414 de->d_name);
415 if (load_sys(path, vbuf) < 0)
416 continue;
417 if (strncmp(vbuf, "external:", 9) != 0 ||
418 !is_subarray(sra->sys_name+9) ||
419 strncmp(vbuf+10, sra->sys_name, nlen) != 0 ||
420 vbuf[10+nlen] != '/')
421 continue;
422 dn = devname2devnum(de->d_name);
423 printf(" %s", map_dev(dev2major(dn),
424 dev2minor(dn), 1));
425 }
426 if (dir)
427 closedir(dir);
428 printf("\n\n");
429 }
430
431 if (array.raid_disks)
432 printf(" Number Major Minor RaidDevice State\n");
433 else
434 printf(" Number Major Minor RaidDevice\n");
cd29a5c8 435 }
b0c63f32
NB
436 disks = malloc(max_disks * sizeof(mdu_disk_info_t));
437 for (d=0; d<max_disks; d++) {
438 disks[d].state = (1<<MD_DISK_REMOVED);
439 disks[d].major = disks[d].minor = 0;
8352ab3e 440 disks[d].number = disks[d].raid_disk = d;
b0c63f32
NB
441 }
442
443 next = array.raid_disks;
444 for (d=0; d < max_disks; d++) {
64c4757e
NB
445 mdu_disk_info_t disk;
446 disk.number = d;
447 if (ioctl(fd, GET_DISK_INFO, &disk) < 0) {
e0d19036 448 if (d < array.raid_disks)
b83d95f3 449 fprintf(stderr, Name ": cannot get device detail for device %d: %s\n",
e0d19036 450 d, strerror(errno));
64c4757e
NB
451 continue;
452 }
67687afe
NB
453 if (disk.major == 0 && disk.minor == 0)
454 continue;
aba69144 455 if (disk.raid_disk >= 0 && disk.raid_disk < array.raid_disks)
b0c63f32
NB
456 disks[disk.raid_disk] = disk;
457 else if (next < max_disks)
458 disks[next++] = disk;
459 }
460
a77be586 461 avail = calloc(array.raid_disks, 1);
b0c63f32
NB
462 for (d= 0; d < max_disks; d++) {
463 char *dv;
464 mdu_disk_info_t disk = disks[d];
465
e0d19036
NB
466 if (d >= array.raid_disks &&
467 disk.major == 0 &&
468 disk.minor == 0)
469 continue;
cd29a5c8 470 if (!brief) {
b0c63f32 471 if (d == array.raid_disks) printf("\n");
e5329c37 472 if (disk.raid_disk < 0)
aba69144 473 printf(" %5d %5d %5d - ",
e5329c37
NB
474 disk.number, disk.major, disk.minor);
475 else
aba69144 476 printf(" %5d %5d %5d %5d ",
e5329c37 477 disk.number, disk.major, disk.minor, disk.raid_disk);
c69b251b
N
478 }
479 if (!brief && array.raid_disks) {
480
aba69144
NB
481 if (disk.state & (1<<MD_DISK_FAULTY)) {
482 printf(" faulty");
e5329c37
NB
483 if (disk.raid_disk < array.raid_disks &&
484 disk.raid_disk >= 0)
485 failed++;
486 }
cd29a5c8
NB
487 if (disk.state & (1<<MD_DISK_ACTIVE)) printf(" active");
488 if (disk.state & (1<<MD_DISK_SYNC)) printf(" sync");
489 if (disk.state & (1<<MD_DISK_REMOVED)) printf(" removed");
b0c63f32
NB
490 if (disk.state & (1<<MD_DISK_WRITEMOSTLY)) printf(" writemostly");
491 if ((disk.state &
492 ((1<<MD_DISK_ACTIVE)|(1<<MD_DISK_SYNC)|(1<<MD_DISK_REMOVED)))
493 == 0) {
494 printf(" spare");
e5329c37
NB
495 if (is_26) {
496 if (disk.raid_disk < array.raid_disks && disk.raid_disk >= 0)
497 printf(" rebuilding");
498 } else if (is_rebuilding && failed) {
499 /* Taking a bit of a risk here, we remove the
500 * device from the array, and then put it back.
501 * If this fails, we are rebuilding
502 */
0df46c2a
NB
503 int err = ioctl(fd, HOT_REMOVE_DISK, makedev(disk.major, disk.minor));
504 if (err == 0) ioctl(fd, HOT_ADD_DISK, makedev(disk.major, disk.minor));
e5329c37
NB
505 if (err && errno == EBUSY)
506 printf(" rebuilding");
507 }
508 }
feb716e9 509 }
e5329c37 510 if (disk.state == 0) spares++;
a77be586
NB
511 if (test && d < array.raid_disks
512 && !(disk.state & (1<<MD_DISK_SYNC)))
feb716e9 513 rv |= 1;
a77be586
NB
514 if (d < array.raid_disks
515 && (disk.state & (1<<MD_DISK_SYNC))) {
516 avail_disks ++;
517 avail[d] = 1;
cd29a5c8 518 }
16c6fa80 519 if ((dv=map_dev(disk.major, disk.minor, 0))) {
d013a55e
NB
520 if (brief) {
521 if (devices) {
522 devices = realloc(devices,
523 strlen(devices)+1+strlen(dv)+1);
524 strcat(strcat(devices,","),dv);
525 } else
526 devices = strdup(dv);
527 } else
528 printf(" %s", dv);
82b27616 529 }
cd29a5c8 530 if (!brief) printf("\n");
64c4757e 531 }
c69b251b 532 if (spares && brief && array.raid_disks) printf(" spares=%d", spares);
3da92f27
NB
533 if (brief && st && st->sb)
534 st->ss->brief_detail_super(st);
535 st->ss->free_super(st);
4b1ac34b 536
22892d56 537 if (brief > 1 && devices) printf("\n devices=%s", devices);
cd29a5c8 538 if (brief) printf("\n");
a77be586
NB
539 if (test &&
540 !enough(array.level, array.raid_disks, array.layout,
541 1, avail, avail_disks))
542 rv = 2;
543
a328c097 544out:
e5329c37 545 close(fd);
feb716e9 546 return rv;
64c4757e 547}
4cce4069
DW
548
549int Detail_Platform(struct superswitch *ss, int scan, int verbose)
550{
551 /* display platform capabilities for the given metadata format
552 * 'scan' in this context means iterate over all metadata types
553 */
554 int i;
555 int err = 1;
556
557 if (ss && ss->detail_platform)
5615172f 558 err = ss->detail_platform(verbose, 0);
4cce4069
DW
559 else if (ss) {
560 if (verbose)
561 fprintf(stderr, Name ": %s metadata is platform independent\n",
562 ss->name ? : "[no name]");
563 } else if (!scan) {
564 if (verbose)
565 fprintf(stderr, Name ": specify a metadata type or --scan\n");
566 }
567
568 if (!scan)
569 return err;
570
571 for (i = 0; superlist[i]; i++) {
572 struct superswitch *meta = superlist[i];
573
574 if (meta == ss)
575 continue;
576 if (verbose)
577 fprintf(stderr, Name ": checking metadata %s\n",
578 meta->name ? : "[no name]");
579 if (!meta->detail_platform) {
580 if (verbose)
581 fprintf(stderr, Name ": %s metadata is platform independent\n",
582 meta->name ? : "[no name]");
583 } else
5615172f 584 err |= meta->detail_platform(verbose, 0);
4cce4069
DW
585 }
586
587 return err;
588}