shutdown: Add Xen kexec support
In the Xen case, it's the hypervisor which manages kexec. We thus have to ask it whether a kernel is loaded, instead of relying on /sys/kernel/kexec_loaded.
This commit is contained in:
committed by
Luca Boccassi
parent
23f3a6f5ff
commit
ede5a78f50
@@ -23,15 +23,6 @@ int saved_argc = 0;
|
||||
char **saved_argv = NULL;
|
||||
static int saved_in_initrd = -1;
|
||||
|
||||
bool kexec_loaded(void) {
|
||||
_cleanup_free_ char *s = NULL;
|
||||
|
||||
if (read_one_line_file("/sys/kernel/kexec_loaded", &s) < 0)
|
||||
return false;
|
||||
|
||||
return s[0] == '1';
|
||||
}
|
||||
|
||||
int prot_from_flags(int flags) {
|
||||
|
||||
switch (flags & O_ACCMODE) {
|
||||
|
||||
@@ -19,8 +19,6 @@ static inline void save_argc_argv(int argc, char **argv) {
|
||||
saved_argv = argv;
|
||||
}
|
||||
|
||||
bool kexec_loaded(void);
|
||||
|
||||
int prot_from_flags(int flags) _const_;
|
||||
|
||||
bool in_initrd(void);
|
||||
|
||||
Reference in New Issue
Block a user