} while (0);
BT_HIDDEN
-bool lttng_live_graph_is_canceled(struct lttng_live_component *lttng_live)
+bool lttng_live_graph_is_canceled(struct lttng_live_msg_iter *msg_iter)
{
- const bt_component *component;
bool ret;
- if (!lttng_live) {
+ if (!msg_iter) {
ret = false;
goto end;
}
- component = bt_self_component_as_component(lttng_live->self_comp);
- ret = bt_component_graph_is_canceled(component);
+ ret = bt_self_message_iterator_is_interrupted(
+ msg_iter->self_msg_iter);
end:
return ret;
static
void lttng_live_destroy_session(struct lttng_live_session *session)
{
- struct lttng_live_component *live_comp;
bt_logging_level log_level;
bt_self_component *self_comp;
BT_COMP_LOGD("Destroy lttng live session");
if (session->id != -1ULL) {
if (lttng_live_detach_session(session)) {
- live_comp = session->lttng_live_msg_iter->lttng_live_comp;
if (session->lttng_live_msg_iter &&
- !lttng_live_graph_is_canceled(live_comp)) {
+ !lttng_live_graph_is_canceled(
+ session->lttng_live_msg_iter)) {
/* Old relayd cannot detach sessions. */
BT_COMP_LOGD("Unable to detach lttng live session %" PRIu64,
session->id);
ret = lttng_live_attach_session(session);
if (ret) {
if (lttng_live_msg_iter && lttng_live_graph_is_canceled(
- lttng_live_msg_iter->lttng_live_comp)) {
+ lttng_live_msg_iter)) {
status = LTTNG_LIVE_ITERATOR_STATUS_AGAIN;
} else {
status = LTTNG_LIVE_ITERATOR_STATUS_ERROR;
live_status = lttng_live_iterator_next_handle_one_quiescent_stream(
lttng_live_msg_iter, stream_iter, curr_msg);
if (live_status != LTTNG_LIVE_ITERATOR_STATUS_OK) {
- BT_ASSERT(*curr_msg == NULL);
+ BT_ASSERT(!*curr_msg);
goto end;
}
if (*curr_msg) {
live_status = lttng_live_iterator_next_handle_one_active_data_stream(
lttng_live_msg_iter, stream_iter, curr_msg);
if (live_status != LTTNG_LIVE_ITERATOR_STATUS_OK) {
- BT_ASSERT(*curr_msg == NULL);
+ BT_ASSERT(!*curr_msg);
}
end:
url_value = bt_value_map_borrow_entry_value_const(params, URL_PARAM);
if (!url_value) {
- BT_COMP_LOGW("Mandatory `%s` parameter missing", URL_PARAM);
- status = BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_INVALID_PARAMS;
+ BT_COMP_LOGE("Mandatory `%s` parameter missing", URL_PARAM);
+ status = BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR;
goto error;
}
if (!bt_value_is_string(url_value)) {
- BT_COMP_LOGW("`%s` parameter is required to be a string value",
+ BT_COMP_LOGE("`%s` parameter is required to be a string value",
URL_PARAM);
- status = BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_INVALID_PARAMS;
+ status = BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR;
goto error;
}
goto error;
}
- if (lttng_live_graph_is_canceled(lttng_live)) {
- ret = BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR;
- goto error;
- }
-
add_port_status = bt_self_component_source_add_output_port(
self_comp_src, "out", NULL, NULL);
switch (add_port_status) {