ia64/xen-unstable

changeset 13831:82171212156b

New domain builder arch_setup hook clean up.
arch_setup_early -> arch_setup_meminit
arch_setup_middle -> arch_setup_bootearly
arch_setup_late -> arch_setup_bootlate

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author kfraser@localhost.localdomain
date Fri Feb 02 15:50:27 2007 +0000 (2007-02-02)
parents ed68ca4368fa
children a39a2f18429c
files tools/libxc/xc_dom_boot.c tools/libxc/xc_dom_ia64.c
line diff
     1.1 --- a/tools/libxc/xc_dom_boot.c	Fri Feb 02 15:41:45 2007 +0000
     1.2 +++ b/tools/libxc/xc_dom_boot.c	Fri Feb 02 15:50:27 2007 +0000
     1.3 @@ -144,7 +144,7 @@ static int x86_shadow(int xc, domid_t do
     1.4      return rc;
     1.5  }
     1.6  
     1.7 -static int arch_setup_early(struct xc_dom_image *dom)
     1.8 +static int arch_setup_meminit(struct xc_dom_image *dom)
     1.9  {
    1.10      int rc = 0;
    1.11  
    1.12 @@ -157,13 +157,13 @@ static int arch_setup_early(struct xc_do
    1.13      return rc;
    1.14  }
    1.15  
    1.16 -static int arch_setup_middle(struct xc_dom_image *dom)
    1.17 +static int arch_setup_bootearly(struct xc_dom_image *dom)
    1.18  {
    1.19      xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
    1.20      return 0;
    1.21  }
    1.22  
    1.23 -static int arch_setup_late(struct xc_dom_image *dom)
    1.24 +static int arch_setup_bootlate(struct xc_dom_image *dom)
    1.25  {
    1.26      static const struct {
    1.27  	char *guest;
    1.28 @@ -263,13 +263,13 @@ static int arch_setup_late(struct xc_dom
    1.29  
    1.30  #elif defined(__ia64__)
    1.31  
    1.32 -static int arch_setup_early(struct xc_dom_image *dom)
    1.33 +static int arch_setup_meminit(struct xc_dom_image *dom)
    1.34  {
    1.35      xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
    1.36      return 0;
    1.37  }
    1.38  
    1.39 -static int arch_setup_middle(struct xc_dom_image *dom)
    1.40 +static int arch_setup_bootearly(struct xc_dom_image *dom)
    1.41  {
    1.42      DECLARE_DOMCTL;
    1.43      int rc;
    1.44 @@ -281,10 +281,6 @@ static int arch_setup_middle(struct xc_d
    1.45      domctl.domain = dom->guest_domid;
    1.46      domctl.u.arch_setup.flags = 0;
    1.47  
    1.48 -    /* dom->start_info_pfn should be initialized by alloc_magic_pages().
    1.49 -     * However it is called later. So we initialize here.
    1.50 -     */
    1.51 -    dom->start_info_pfn = dom->total_pages - 3;
    1.52      domctl.u.arch_setup.bp = (dom->start_info_pfn << PAGE_SHIFT)
    1.53  	+ sizeof(start_info_t);
    1.54      /* 3 = start info page, xenstore page and console page */
    1.55 @@ -293,7 +289,7 @@ static int arch_setup_middle(struct xc_d
    1.56      return rc;
    1.57  }
    1.58  
    1.59 -static int arch_setup_late(struct xc_dom_image *dom)
    1.60 +static int arch_setup_bootlate(struct xc_dom_image *dom)
    1.61  {
    1.62      unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
    1.63      shared_info_t *shared_info;
    1.64 @@ -317,19 +313,19 @@ static int arch_setup_late(struct xc_dom
    1.65  
    1.66  #elif defined(__powerpc64__)
    1.67  
    1.68 -static int arch_setup_early(struct xc_dom_image *dom)
    1.69 +static int arch_setup_meminit(struct xc_dom_image *dom)
    1.70  {
    1.71      xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
    1.72      return 0;
    1.73  }
    1.74  
    1.75 -static int arch_setup_middle(struct xc_dom_image *dom)
    1.76 +static int arch_setup_bootearly(struct xc_dom_image *dom)
    1.77  {
    1.78      xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
    1.79      return 0;
    1.80  }
    1.81  
    1.82 -static int arch_setup_late(struct xc_dom_image *dom)
    1.83 +static int arch_setup_bootlate(struct xc_dom_image *dom)
    1.84  {
    1.85      start_info_t *si =
    1.86  	xc_dom_pfn_to_ptr(dom, dom->start_info_pfn, 1);
    1.87 @@ -355,19 +351,19 @@ static int arch_setup_late(struct xc_dom
    1.88  
    1.89  #else
    1.90  
    1.91 -static int arch_setup_early(struct xc_dom_image *dom)
    1.92 +static int arch_setup_meminit(struct xc_dom_image *dom)
    1.93  {
    1.94      xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
    1.95      return 0;
    1.96  }
    1.97  
    1.98 -static int arch_setup_middle(struct xc_dom_image *dom)
    1.99 +static int arch_setup_bootearly(struct xc_dom_image *dom)
   1.100  {
   1.101      xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
   1.102      return 0;
   1.103  }
   1.104  
   1.105 -static int arch_setup_late(struct xc_dom_image *dom)
   1.106 +static int arch_setup_bootlate(struct xc_dom_image *dom)
   1.107  {
   1.108      xc_dom_printf("%s: doing nothing\n", __FUNCTION__);
   1.109      return 0;
   1.110 @@ -423,7 +419,7 @@ int xc_dom_boot_mem_init(struct xc_dom_i
   1.111  
   1.112      xc_dom_printf("%s: called\n", __FUNCTION__);
   1.113  
   1.114 -    if (0 != (rc = arch_setup_early(dom)))
   1.115 +    if (0 != (rc = arch_setup_meminit(dom)))
   1.116  	return rc;
   1.117  
   1.118      /* allocate guest memory */
   1.119 @@ -438,9 +434,6 @@ int xc_dom_boot_mem_init(struct xc_dom_i
   1.120  	return rc;
   1.121      }
   1.122  
   1.123 -    if (0 != (rc = arch_setup_middle(dom)))
   1.124 -        return rc;
   1.125 -
   1.126      return 0;
   1.127  }
   1.128  
   1.129 @@ -497,6 +490,10 @@ int xc_dom_boot_image(struct xc_dom_imag
   1.130  
   1.131      xc_dom_printf("%s: called\n", __FUNCTION__);
   1.132  
   1.133 +    /* misc ia64 stuff*/
   1.134 +    if (0 != (rc = arch_setup_bootearly(dom)))
   1.135 +	return rc;
   1.136 +
   1.137      /* collect some info */
   1.138      domctl.cmd = XEN_DOMCTL_getdomaininfo;
   1.139      domctl.domain = dom->guest_domid;
   1.140 @@ -542,7 +539,7 @@ int xc_dom_boot_image(struct xc_dom_imag
   1.141      xc_dom_log_memory_footprint(dom);
   1.142  
   1.143      /* misc x86 stuff */
   1.144 -    if (0 != (rc = arch_setup_late(dom)))
   1.145 +    if (0 != (rc = arch_setup_bootlate(dom)))
   1.146  	return rc;
   1.147  
   1.148      /* let the vm run */
     2.1 --- a/tools/libxc/xc_dom_ia64.c	Fri Feb 02 15:41:45 2007 +0000
     2.2 +++ b/tools/libxc/xc_dom_ia64.c	Fri Feb 02 15:50:27 2007 +0000
     2.3 @@ -26,11 +26,7 @@ static int alloc_magic_pages(struct xc_d
     2.4      /* allocate special pages */
     2.5      dom->console_pfn = dom->total_pages -1;
     2.6      dom->xenstore_pfn = dom->total_pages -2;
     2.7 -
     2.8 -    /*
     2.9 -     * this is initialized by arch_setup_middle().
    2.10 -     * dom->start_info_pfn = dom->total_pages -3;
    2.11 -     */
    2.12 +    dom->start_info_pfn = dom->total_pages -3;
    2.13      return 0;
    2.14  }
    2.15