- ident.autof = autof;
- rv2 = Assemble(ss, NULL, -1,
- &ident, configfile,
- devlist, NULL,
- readonly, runstop, NULL, homehost, verbose-quiet, force);
- if (rv2==0)
- cnt++;
- } while (rv2==0);
+ mddev_dev_t devlist = conf_get_devs();
+ acnt = 0;
+ do {
+ rv2 = Assemble(ss, NULL,
+ &ident,
+ devlist, NULL,
+ readonly, runstop, NULL, homehost, verbose-quiet, force);
+ if (rv2==0) {
+ cnt++;
+ acnt++;
+ }
+ if (rv2 == 1)
+ /* found something so even though assembly failed we
+ * want to avoid auto-updates
+ */
+ auto_update_home = 0;
+ } while (rv2!=2);
+ /* Incase there are stacked devices, we need to go around again */
+ } while (acnt);
+ if (cnt == 0 && auto_update_home && homehost) {
+ /* Nothing found, maybe we need to bootstrap homehost info */
+ do {
+ acnt = 0;
+ do {
+ rv2 = Assemble(ss, NULL,
+ &ident,
+ NULL, NULL,
+ readonly, runstop, "homehost", homehost, verbose-quiet, force);
+ if (rv2==0) {
+ cnt++;
+ acnt++;
+ }
+ } while (rv2!=2);
+ /* Incase there are stacked devices, we need to go around again */
+ } while (acnt);
+ }