- if (ident->uuid_set && (!update || strcmp(update, "uuid")!= 0) &&
- (!tst || !tst->sb ||
- same_uuid(content->uuid, ident->uuid, tst->ss->swapuuid)==0)) {
- if (report_missmatch)
- fprintf(stderr, Name ": %s has wrong uuid.\n",
- devname);
- goto loop;
- }
- if (ident->name[0] && (!update || strcmp(update, "name")!= 0) &&
- (!tst || !tst->sb ||
- name_matches(content->name, ident->name, homehost)==0)) {
- if (report_missmatch)
- fprintf(stderr, Name ": %s has wrong name.\n",
- devname);
- goto loop;
- }
- if (ident->super_minor != UnSet &&
- (!tst || !tst->sb ||
- ident->super_minor != content->array.md_minor)) {
- if (report_missmatch)
- fprintf(stderr, Name ": %s has wrong super-minor.\n",
- devname);
- goto loop;
- }
- if (ident->level != UnSet &&
- (!tst || !tst->sb ||
- ident->level != content->array.level)) {
- if (report_missmatch)
- fprintf(stderr, Name ": %s has wrong raid level.\n",
- devname);
- goto loop;
- }
- if (ident->raid_disks != UnSet &&
- (!tst || !tst->sb ||
- ident->raid_disks!= content->array.raid_disks)) {
- if (report_missmatch)
- fprintf(stderr, Name ": %s requires wrong number of drives.\n",
- devname);
- goto loop;
- }
- if (auto_assem) {
- if (tst == NULL || tst->sb == NULL)
- continue;
- }
- /* If we are this far, then we are nearly commited to this device.
- * If the super_block doesn't exist, or doesn't match others,
- * then we probably cannot continue
- * However if one of the arrays is for the homehost, and
- * the other isn't that can disambiguate.
- */
-
- if (!tst || !tst->sb) {
- fprintf(stderr, Name ": %s has no superblock - assembly aborted\n",
- devname);
- if (st)
- st->ss->free_super(st);
- return 1;
- }
-
- if (tst && tst->sb && tst->ss->container_content
- && tst->loaded_container) {
- /* we have the one container we need, don't keep
- * looking. If the chosen member is active, skip.
- */
- if (is_member_busy(content->text_version)) {
- if (report_missmatch)
- fprintf(stderr, Name ": member %s in %s is already assembled\n",
+ if (!ident_matches(ident, content, tst,
+ homehost, update,
+ report_missmatch ? devname : NULL))
+ /* message already printed */;
+ else if (is_member_busy(content->text_version)) {
+ if (report_missmatch)
+ fprintf(stderr, Name ": member %s in %s is already assembled\n",
+ content->text_version,
+ devname);
+ } else if (content->array.state & (1<<MD_SB_BLOCK_VOLUME)) {
+ /* do not assemble arrays with unsupported configurations */
+ fprintf(stderr, Name ": Cannot activate member %s in %s.\n",