direct-io.hg
changeset 12874:27c2e9aa83e9
[IA64][LIBXC] prep for fixes
Groundwork for real fixes to follow
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Groundwork for real fixes to follow
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author | awilliam@xenbuild.aw |
---|---|
date | Tue Dec 05 09:09:44 2006 -0700 (2006-12-05) |
parents | e5e6893ec699 |
children | ba7fca36fbd0 |
files | tools/libxc/ia64/xc_ia64_hvm_build.c tools/libxc/xc_linux_build.c |
line diff
1.1 --- a/tools/libxc/ia64/xc_ia64_hvm_build.c Mon Dec 04 08:44:57 2006 -0700 1.2 +++ b/tools/libxc/ia64/xc_ia64_hvm_build.c Tue Dec 05 09:09:44 2006 -0700 1.3 @@ -581,8 +581,7 @@ add_pal_hob(void* hob_buf) 1.4 */ 1.5 static int 1.6 setup_guest(int xc_handle, uint32_t dom, unsigned long memsize, 1.7 - char *image, unsigned long image_size, uint32_t vcpus, 1.8 - unsigned int store_evtchn, unsigned long *store_mfn) 1.9 + char *image, unsigned long image_size, vcpu_guest_context_t *ctxt) 1.10 { 1.11 xen_pfn_t *pfn_list; 1.12 shared_iopage_t *sp; 1.13 @@ -669,11 +668,6 @@ setup_guest(int xc_handle, uint32_t dom, 1.14 if (xc_domctl(xc_handle, &domctl)) 1.15 goto error_out; 1.16 1.17 - if (xc_domain_translate_gpfn_list(xc_handle, dom, nr_pages, 1.18 - pfn_list, pfn_list)) { 1.19 - PERROR("Could not translate addresses of HVM guest.\n"); 1.20 - goto error_out; 1.21 - } 1.22 1.23 // Load guest firmware 1.24 if (xc_ia64_copy_to_domain_pages(xc_handle, dom, image, 1.25 @@ -692,10 +686,8 @@ setup_guest(int xc_handle, uint32_t dom, 1.26 1.27 xc_set_hvm_param(xc_handle, dom, 1.28 HVM_PARAM_STORE_PFN, STORE_PAGE_START>>PAGE_SHIFT); 1.29 - xc_set_hvm_param(xc_handle, dom, HVM_PARAM_STORE_EVTCHN, store_evtchn); 1.30 1.31 // Retrieve special pages like io, xenstore, etc. 1.32 - *store_mfn = pfn_list[nr_pages - 2]; 1.33 sp = (shared_iopage_t *)xc_map_foreign_range(xc_handle, dom, PAGE_SIZE, 1.34 PROT_READ | PROT_WRITE, 1.35 pfn_list[nr_pages - 3]); 1.36 @@ -717,12 +709,9 @@ error_out: 1.37 } 1.38 1.39 int 1.40 -xc_hvm_build(int xc_handle, uint32_t domid, int memsize, 1.41 - const char *image_name, unsigned int vcpus, unsigned int pae, 1.42 - unsigned int acpi, unsigned int store_evtchn, 1.43 - unsigned long *store_mfn) 1.44 +xc_hvm_build(int xc_handle, uint32_t domid, int memsize, const char *image_name) 1.45 { 1.46 - struct xen_domctl launch_domctl, domctl; 1.47 + struct xen_domctl launch_domctl; 1.48 int rc; 1.49 vcpu_guest_context_t st_ctxt, *ctxt = &st_ctxt; 1.50 char *image = NULL; 1.51 @@ -748,18 +737,10 @@ xc_hvm_build(int xc_handle, uint32_t dom 1.52 return 1; 1.53 } 1.54 1.55 - domctl.cmd = XEN_DOMCTL_getdomaininfo; 1.56 - domctl.domain = (domid_t)domid; 1.57 - if (do_domctl(xc_handle, &domctl) < 0 || 1.58 - (uint16_t)domctl.domain != domid) { 1.59 - PERROR("Could not get info on domain"); 1.60 - goto error_out; 1.61 - } 1.62 - 1.63 memset(ctxt, 0, sizeof(*ctxt)); 1.64 1.65 if (setup_guest(xc_handle, domid, (unsigned long)memsize, image, 1.66 - image_size, vcpus, store_evtchn, store_mfn) < 0) { 1.67 + image_size, ctxt) < 0) { 1.68 ERROR("Error constructing guest OS"); 1.69 goto error_out; 1.70 }
2.1 --- a/tools/libxc/xc_linux_build.c Mon Dec 04 08:44:57 2006 -0700 2.2 +++ b/tools/libxc/xc_linux_build.c Tue Dec 05 09:09:44 2006 -0700 2.3 @@ -565,6 +565,9 @@ static int setup_guest(int xc_handle, 2.4 start_info = xc_map_foreign_range( 2.5 xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, 2.6 page_array[nr_pages - 3]); 2.7 + if ( start_info == NULL ) 2.8 + goto error_out; 2.9 + 2.10 memset(start_info, 0, sizeof(*start_info)); 2.11 rc = xc_version(xc_handle, XENVER_version, NULL); 2.12 sprintf(start_info->magic, "xen-%i.%i-ia64", rc >> 16, rc & (0xFFFF));