mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/xenstore: perform kexec for stubdom live update
For the final step of live-update in stubdom, call kexec(). Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
This commit is contained in:
1 parent
140a682737
commit
38286e84a8
1 file changed
+32
-1
@@ -8,13 +8,44 @@
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include <mini-os/kexec.h>
|
||||
|
||||
#include "talloc.h"
|
||||
#include "lu.h"
|
||||
#include "core.h"
|
||||
|
||||
#ifndef NO_LIVE_UPDATE
|
||||
char *lu_exec(const void *ctx, int argc, char **argv)
|
||||
{
|
||||
return "NYI";
|
||||
int i;
|
||||
int ret;
|
||||
char *errbuf;
|
||||
char *cmdline;
|
||||
|
||||
if (!lu_status->kernel)
|
||||
return "No new kernel";
|
||||
|
||||
cmdline = talloc_strdup(ctx, "");
|
||||
if (!cmdline)
|
||||
return "Allocation failure";
|
||||
for (i = 1; argv[i]; i++) {
|
||||
if (i > 1) {
|
||||
cmdline = talloc_append_string(ctx, cmdline, " ");
|
||||
if (!cmdline)
|
||||
return "Allocation failure";
|
||||
}
|
||||
cmdline = talloc_append_string(ctx, cmdline, argv[i]);
|
||||
if (!cmdline)
|
||||
return "Allocation failure";
|
||||
}
|
||||
|
||||
ret = kexec(lu_status->kernel, lu_status->kernel_size, cmdline);
|
||||
|
||||
errbuf = talloc_asprintf(ctx, "kexec() returned %d", ret);
|
||||
if (!errbuf)
|
||||
errbuf = "kexec() returned";
|
||||
|
||||
return errbuf;
|
||||
}
|
||||
|
||||
static const char *lu_binary_alloc(const void *ctx, struct connection *conn,
|
||||
|
||||