On Wed, 8 Jul 2026 at 11:11, Peter Maydell <[email protected]> wrote:
> How about we use glib's GPtrArray and g_strjoinv() instead of
> manually building the string? Something like:
>
>
> g_autoptr(GPtrArray) blocker_features = g_ptr_array_new();
>
> if (...) {
> g_ptr_array_add(blocker_features, "SR-IOV");
> }
> [etc...]
>
>
> if (blocker_features->len > 0) {
> g_autofree blocker_list = NULL;
whoops, forgot to put the type in:
g_autofree char *blocker_list = NULL;
>
> g_ptr_array_add(blocker_features, NULL);
> blocker_list = g_strjoinv(", ", (void *)blocker_features->pdata);
> error_setg(&n->migration_blocker,
> "Migration is not supported for %s", blocker_list);
> if (migrate_add_blocker(&n->migration_blocker, errp) < 0) {
> return false;
> }
> }
-- PMM