+ goto error;
+ }
+
+ /*
+ * Append parameters and log levels of all the
+ * non-option arguments that contributed to this
+ * component instance coming into existence.
+ */
+ orig_indices_count = bt_value_array_get_length(res->original_input_indices);
+ for (orig_indices_i = 0; orig_indices_i < orig_indices_count; orig_indices_i++) {
+ const bt_value *orig_idx_value =
+ bt_value_array_borrow_element_by_index(
+ res->original_input_indices, orig_indices_i);
+ uint64_t orig_idx = bt_value_integer_unsigned_get(orig_idx_value);
+ const bt_value *params_array =
+ bt_value_array_borrow_element_by_index_const(
+ non_opt_params, orig_idx);
+ uint64_t params_i, params_count;
+ const bt_value *loglevel_value;
+
+ params_count = bt_value_array_get_length(params_array);
+ for (params_i = 0; params_i < params_count; params_i++) {
+ const bt_value *params_value =
+ bt_value_array_borrow_element_by_index_const(
+ params_array, params_i);
+ const char *params = bt_value_string_get(params_value);
+ bt_value_array_append_element_status append_status;
+
+ append_status = bt_value_array_append_string_element(
+ comp->extra_params, "--params");
+ if (append_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
+ BT_CLI_LOGE_APPEND_CAUSE("Failed to append array element.");
+ goto error;
+ }
+
+ append_status = bt_value_array_append_string_element(
+ comp->extra_params, params);
+ if (append_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
+ BT_CLI_LOGE_APPEND_CAUSE("Failed to append array element.");
+ goto error;
+ }
+ }
+
+ loglevel_value = bt_value_array_borrow_element_by_index_const(
+ non_opt_loglevels, orig_idx);
+ if (bt_value_get_type(loglevel_value) == BT_VALUE_TYPE_STRING) {
+ const char *loglevel = bt_value_string_get(loglevel_value);
+ bt_value_array_append_element_status append_status;
+
+ append_status = bt_value_array_append_string_element(
+ comp->extra_params, "--log-level");
+ if (append_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
+ BT_CLI_LOGE_APPEND_CAUSE("Failed to append array element.");
+ goto error;
+ }
+
+ append_status = bt_value_array_append_string_element(
+ comp->extra_params, loglevel);
+ if (append_status != BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK) {
+ BT_CLI_LOGE_APPEND_CAUSE("Failed to append array element.");
+ goto error;
+ }
+ }