Markus Armbruster <arm...@redhat.com> writes: [...]
> Apropos blocked-reasons. migration.json has: > > # @blocked: True if outgoing migration is blocked (since 6.0) > # > # @blocked-reasons: A list of reasons an outgoing migration is blocked > (since 6.0) > [...] > 'blocked': 'bool', > '*blocked-reasons': ['str'], > > Can "blocked-reasons" be absent or empty when "blocked" is true? No. >From fill_source_migration_info(): info->blocked = migration_is_blocked(NULL); info->has_blocked_reasons = info->blocked; info->blocked_reasons = NULL; if (info->blocked) { GSList *cur_blocker = migration_blockers; /* * There are two types of reasons a migration might be blocked; * a) devices marked in VMState as non-migratable, and * b) Explicit migration blockers * We need to add both of them here. */ qemu_savevm_non_migratable_list(&info->blocked_reasons); while (cur_blocker) { QAPI_LIST_PREPEND(info->blocked_reasons, g_strdup(error_get_pretty(cur_blocker->data))); cur_blocker = g_slist_next(cur_blocker); } } where bool migration_is_blocked(Error **errp) { if (qemu_savevm_state_blocked(errp)) { return true; } if (migration_blockers) { error_propagate(errp, error_copy(migration_blockers->data)); return true; } return false; } and bool qemu_savevm_state_blocked(Error **errp) { SaveStateEntry *se; QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { if (se->vmsd && se->vmsd->unmigratable) { error_setg(errp, "State blocked by non-migratable device '%s'", se->idstr); return true; } } return false; } void qemu_savevm_non_migratable_list(strList **reasons) { SaveStateEntry *se; QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { if (se->vmsd && se->vmsd->unmigratable) { QAPI_LIST_PREPEND(*reasons, g_strdup_printf("non-migratable device: %s", se->idstr)); } } } info->blocked is "non-migratable devices exist, or migration blockers exist". info->blocked_reasons has one entry per non-migratable device, and one entry per migration blocker. > If not, then "blocked" is redundant, and should be dropped before we > release 6.0. It is, and it should. > Else, the documentation should spell it out. No need to rush that. > > The patch was not cc'ed to me. I might have caught it earlier... "The patch" is commit 3af8554bd0 "migration: Add blocker information" > > [...]