Command to rename a folder
[lttng-tools.git] / src / common / kernel-consumer / kernel-consumer.c
index 5619024661d462dc56c79bacfb9fa433b66049a3..185d42320731d026e26a167a3809a731ce597b05 100644 (file)
@@ -1072,6 +1072,31 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                }
                break;
        }
+       case LTTNG_CONSUMER_ROTATE_RENAME:
+       {
+               DBG("Consumer rename session %" PRIu64 " after rotation, old path = \"%s\", new path = \"%s\"",
+                               msg.u.rotate_rename.session_id,
+                               msg.u.rotate_rename.old_path,
+                               msg.u.rotate_rename.new_path);
+               ret = lttng_consumer_rotate_rename(msg.u.rotate_rename.old_path,
+                               msg.u.rotate_rename.new_path,
+                               msg.u.rotate_rename.uid,
+                               msg.u.rotate_rename.gid,
+                               msg.u.rotate_rename.relayd_id);
+               if (ret < 0) {
+                       ERR("Rotate rename failed");
+                       ret_code = LTTCOMM_CONSUMERD_CHAN_NOT_FOUND;
+               }
+
+               health_code_update();
+
+               ret = consumer_send_status_msg(sock, ret_code);
+               if (ret < 0) {
+                       /* Somehow, the session daemon is not responding anymore. */
+                       goto end_nosignal;
+               }
+               break;
+       }
        case LTTNG_CONSUMER_MKDIR:
        {
                DBG("Consumer mkdir %s in session %" PRIu64,
This page took 0.024247 seconds and 5 git commands to generate.