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:
Juergen Gross authored and Jan Beulich committed 2025-07-17 12:48:35 +02:00
1 parent 140a682737
commit 38286e84a8
1 file changed
+32 -1
+32 -1
View File
@@ -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,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.