diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libxc/xc_core.c | 2 | ||||
-rw-r--r-- | tools/libxc/xc_ptrace_core.c | 7 | ||||
-rw-r--r-- | tools/libxc/xenctrl.h | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c index 0c763bbf8f..34c6d16a8c 100644 --- a/tools/libxc/xc_core.c +++ b/tools/libxc/xc_core.c @@ -61,7 +61,7 @@ xc_domain_dumpcore(int xc_handle, nr_pages = info.nr_pages; - header.xch_magic = 0xF00FEBED; + header.xch_magic = XC_CORE_MAGIC; header.xch_nr_vcpus = nr_vcpus; header.xch_nr_pages = nr_pages; header.xch_ctxt_offset = sizeof(struct xc_core_header); diff --git a/tools/libxc/xc_ptrace_core.c b/tools/libxc/xc_ptrace_core.c index 84286cf9e4..7b2233e5a4 100644 --- a/tools/libxc/xc_ptrace_core.c +++ b/tools/libxc/xc_ptrace_core.c @@ -111,6 +111,13 @@ xc_waitdomain_core( if (read(domfd, &header, sizeof(header)) != sizeof(header)) return -1; + if (header.xch_magic != XC_CORE_MAGIC) { + printf("Magic number missmatch: 0x%08x (file) != " + " 0x%08x (code)\n", header.xch_magic, + XC_CORE_MAGIC); + return -1; + } + nr_pages = header.xch_nr_pages; nr_vcpus = header.xch_nr_vcpus; pages_offset = header.xch_pages_offset; diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h index 605e0681f9..f08fd25bc1 100644 --- a/tools/libxc/xenctrl.h +++ b/tools/libxc/xenctrl.h @@ -92,6 +92,7 @@ typedef struct xc_core_header { unsigned int xch_pages_offset; } xc_core_header_t; +#define XC_CORE_MAGIC 0xF00FEBED long xc_ptrace_core( int xc_handle, |