[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v10 11/25] tools/xenstore: add the basic framework for doing the live update



Add the main framework for executing the live update. This for now
only defines the basic execution steps with empty dummy functions.
This final step returning means failure, as in case of success the
new executable will have taken over.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
Reviewed-by: Paul Durrant <paul@xxxxxxx>
---
V4:
- const (Julien Grall)
---
 tools/xenstore/xenstored_control.c | 39 ++++++++++++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/xenstored_control.c 
b/tools/xenstore/xenstored_control.c
index 2e0827b9ef..940b717741 100644
--- a/tools/xenstore/xenstored_control.c
+++ b/tools/xenstore/xenstored_control.c
@@ -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,
-- 
2.26.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.