-/*
- * Delete output by ID (machine interface version).
- */
-static int mi_del_output(uint32_t id, const char *name)
-{
- int ret;
- struct lttng_snapshot_output *output = NULL;
-
- assert(writer);
-
- output = lttng_snapshot_output_create();
- if (!output) {
- ret = CMD_FATAL;
- goto error;
- }
-
- if (name) {
- ret = lttng_snapshot_output_set_name(name, output);
- } else if (id != UINT32_MAX) {
- ret = lttng_snapshot_output_set_id(id, output);
- } else {
- ret = CMD_ERROR;
- goto error;
- }
- if (ret < 0) {
- ret = CMD_FATAL;
- goto error;
- }
-
- ret = lttng_snapshot_del_output(current_session_name, output);
- if (ret < 0) {
- goto error;
- }
-
- ret = mi_lttng_snapshot_del_output(writer, id, name, current_session_name);
- if (ret) {
- ret = CMD_ERROR;
- }
-
-error:
- lttng_snapshot_output_destroy(output);
- return ret;
-}
-