@@ -304,9 +304,27 @@ static const char *lu_arch(const void *ctx, struct connection *conn,
}
#endif
+static const char *lu_check_lu_allowed(const void *ctx, bool force,
+ unsigned int to)
+{
+ return NULL;
+}
+
+static const char *lu_dump_state(const void *ctx, struct connection *conn)
+{
+ return NULL;
+}
+
+static const char *lu_activate_binary(const void *ctx)
+{
+ return "Not yet implemented.";
+}
+
static const char *lu_start(const void *ctx, struct connection *conn,
bool force, unsigned int to)
{
+ const char *ret;
+
syslog(LOG_INFO, "live-update: start, force=%d, to=%u\n", force, to);
if (!lu_status || lu_status->conn != conn)
@@ -317,10 +335,27 @@ static const char *lu_start(const void *ctx, struct connection *conn,
return "Kernel not complete.";
#endif
- /* Will be replaced by real live-update later. */
+ /* Check for state to allow live update. */
+ ret = lu_check_lu_allowed(ctx, force, to);
+ if (ret) {
+ if (!strcmp(ret, "BUSY"))
+ return ret;
+ goto out;
+ }
+
+ /* Dump out internal state, including "OK" for live update. */
+ ret = lu_dump_state(ctx, conn);
+ if (ret)
+ goto out;
+
+ /* Perform the activation of new binary. */
+ ret = lu_activate_binary(ctx);
+ /* We will reach this point only in case of failure. */
+
+ out:
talloc_free(lu_status);
- return NULL;
+ return ret;
}
static int do_control_lu(void *ctx, struct connection *conn,