direct-io.hg
changeset 7511:c5cd971aa96c
To allow kernel to handle radically different hypervisors in the future,
I thought a magic field in the start_info might be useful. I just chose
"Xen-<major>.<minor>", but feel free to change it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (authored)
I thought a magic field in the start_info might be useful. I just chose
"Xen-<major>.<minor>", but feel free to change it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (authored)
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Thu Oct 27 17:47:53 2005 +0100 (2005-10-27) |
parents | f8087c9297aa |
children | 6d4caa5a2cdb |
files | tools/libxc/xc_linux_build.c xen/arch/ia64/xen/domain.c xen/arch/x86/domain_build.c xen/include/public/xen.h |
line diff
1.1 --- a/tools/libxc/xc_linux_build.c Thu Oct 27 17:43:29 2005 +0100 1.2 +++ b/tools/libxc/xc_linux_build.c Thu Oct 27 17:47:53 2005 +0100 1.3 @@ -350,6 +350,8 @@ static int setup_guest(int xc_handle, 1.4 start_info = xc_map_foreign_range( 1.5 xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, page_array[0]); 1.6 memset(start_info, 0, sizeof(*start_info)); 1.7 + rc = xc_version(xc_handle, XENVER_version, NULL); 1.8 + sprintf(start_info->magic, "Xen-%i.%i", rc >> 16, rc & (0xFFFF)); 1.9 start_info->flags = flags; 1.10 start_info->store_mfn = nr_pages - 2; 1.11 start_info->store_evtchn = store_evtchn; 1.12 @@ -624,6 +626,8 @@ static int setup_guest(int xc_handle, 1.13 xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, 1.14 page_array[(vstartinfo_start-dsi.v_start)>>PAGE_SHIFT]); 1.15 memset(start_info, 0, sizeof(*start_info)); 1.16 + rc = xc_version(xc_handle, XENVER_version, NULL); 1.17 + sprintf(start_info->magic, "Xen-%i.%i", rc >> 16, rc & (0xFFFF)); 1.18 start_info->nr_pages = nr_pages; 1.19 start_info->shared_info = shared_info_frame << PAGE_SHIFT; 1.20 start_info->flags = flags;
2.1 --- a/xen/arch/ia64/xen/domain.c Thu Oct 27 17:43:29 2005 +0100 2.2 +++ b/xen/arch/ia64/xen/domain.c Thu Oct 27 17:47:53 2005 +0100 2.3 @@ -28,6 +28,7 @@ 2.4 #include <xen/event.h> 2.5 //#include <xen/shadow.h> 2.6 #include <xen/console.h> 2.7 +#include <xen/compile.h> 2.8 2.9 #include <xen/elf.h> 2.10 //#include <asm/page.h> 2.11 @@ -930,6 +931,7 @@ int construct_dom0(struct domain *d, 2.12 si = (start_info_t *)alloc_xenheap_page(); 2.13 memset(si, 0, PAGE_SIZE); 2.14 d->shared_info->arch.start_info_pfn = __pa(si) >> PAGE_SHIFT; 2.15 + sprintf(si->magic, "Xen-%i.%i", XEN_VERSION, XEN_SUBVERSION); 2.16 2.17 #if 0 2.18 si->nr_pages = d->tot_pages;
3.1 --- a/xen/arch/x86/domain_build.c Thu Oct 27 17:43:29 2005 +0100 3.2 +++ b/xen/arch/x86/domain_build.c Thu Oct 27 17:47:53 2005 +0100 3.3 @@ -15,6 +15,7 @@ 3.4 #include <xen/elf.h> 3.5 #include <xen/kernel.h> 3.6 #include <xen/domain.h> 3.7 +#include <xen/compile.h> 3.8 #include <asm/regs.h> 3.9 #include <asm/system.h> 3.10 #include <asm/io.h> 3.11 @@ -602,6 +603,7 @@ int construct_dom0(struct domain *d, 3.12 si->pt_base = vpt_start; 3.13 si->nr_pt_frames = nr_pt_pages; 3.14 si->mfn_list = vphysmap_start; 3.15 + sprintf(si->magic, "Xen-%i.%i", XEN_VERSION, XEN_SUBVERSION); 3.16 3.17 /* Write the phys->machine and machine->phys table entries. */ 3.18 for ( pfn = 0; pfn < d->tot_pages; pfn++ )
4.1 --- a/xen/include/public/xen.h Thu Oct 27 17:43:29 2005 +0100 4.2 +++ b/xen/include/public/xen.h Thu Oct 27 17:47:53 2005 +0100 4.3 @@ -410,6 +410,7 @@ typedef struct shared_info { 4.4 #define MAX_GUEST_CMDLINE 1024 4.5 typedef struct start_info { 4.6 /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME. */ 4.7 + char magic[32]; /* "Xen-<version>.<subversion>". */ 4.8 unsigned long nr_pages; /* Total pages allocated to this domain. */ 4.9 unsigned long shared_info; /* MACHINE address of shared info struct. */ 4.10 uint32_t flags; /* SIF_xxx flags. */