# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Date 1170298014 -32400 # Node ID c7633b8f37025b19d07eacea16f420aa1edfd859 # Parent 3751a96ba0217690b4f1fedc577ed4d45a7b456e 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 PATCHNAME: new_domain_builder_cleanup Signed-off-by: Isaku Yamahata diff -r 3751a96ba021 -r c7633b8f3702 tools/libxc/xc_dom_boot.c --- a/tools/libxc/xc_dom_boot.c Thu Feb 01 11:50:48 2007 +0900 +++ b/tools/libxc/xc_dom_boot.c Thu Feb 01 11:46:54 2007 +0900 @@ -144,7 +144,7 @@ static int x86_shadow(int xc, domid_t do return rc; } -static int arch_setup_early(struct xc_dom_image *dom) +static int arch_setup_meminit(struct xc_dom_image *dom) { int rc = 0; @@ -157,13 +157,13 @@ static int arch_setup_early(struct xc_do return rc; } -static int arch_setup_middle(struct xc_dom_image *dom) -{ - xc_dom_printf("%s: doing nothing\n", __FUNCTION__); - return 0; -} - -static int arch_setup_late(struct xc_dom_image *dom) +static int arch_setup_bootearly(struct xc_dom_image *dom) +{ + xc_dom_printf("%s: doing nothing\n", __FUNCTION__); + return 0; +} + +static int arch_setup_bootlate(struct xc_dom_image *dom) { static const struct { char *guest; @@ -263,13 +263,13 @@ static int arch_setup_late(struct xc_dom #elif defined(__ia64__) -static int arch_setup_early(struct xc_dom_image *dom) -{ - xc_dom_printf("%s: doing nothing\n", __FUNCTION__); - return 0; -} - -static int arch_setup_middle(struct xc_dom_image *dom) +static int arch_setup_meminit(struct xc_dom_image *dom) +{ + xc_dom_printf("%s: doing nothing\n", __FUNCTION__); + return 0; +} + +static int arch_setup_bootearly(struct xc_dom_image *dom) { DECLARE_DOMCTL; int rc; @@ -281,10 +281,6 @@ static int arch_setup_middle(struct xc_d domctl.domain = dom->guest_domid; domctl.u.arch_setup.flags = 0; - /* dom->start_info_pfn should be initialized by alloc_magic_pages(). - * However it is called later. So we initialize here. - */ - dom->start_info_pfn = dom->total_pages - 3; domctl.u.arch_setup.bp = (dom->start_info_pfn << PAGE_SHIFT) + sizeof(start_info_t); /* 3 = start info page, xenstore page and console page */ @@ -293,7 +289,7 @@ static int arch_setup_middle(struct xc_d return rc; } -static int arch_setup_late(struct xc_dom_image *dom) +static int arch_setup_bootlate(struct xc_dom_image *dom) { unsigned int page_size = XC_DOM_PAGE_SIZE(dom); shared_info_t *shared_info; @@ -317,19 +313,19 @@ static int arch_setup_late(struct xc_dom #elif defined(__powerpc64__) -static int arch_setup_early(struct xc_dom_image *dom) -{ - xc_dom_printf("%s: doing nothing\n", __FUNCTION__); - return 0; -} - -static int arch_setup_middle(struct xc_dom_image *dom) -{ - xc_dom_printf("%s: doing nothing\n", __FUNCTION__); - return 0; -} - -static int arch_setup_late(struct xc_dom_image *dom) +static int arch_setup_meminit(struct xc_dom_image *dom) +{ + xc_dom_printf("%s: doing nothing\n", __FUNCTION__); + return 0; +} + +static int arch_setup_bootearly(struct xc_dom_image *dom) +{ + xc_dom_printf("%s: doing nothing\n", __FUNCTION__); + return 0; +} + +static int arch_setup_bootlate(struct xc_dom_image *dom) { start_info_t *si = xc_dom_pfn_to_ptr(dom, dom->start_info_pfn, 1); @@ -355,19 +351,19 @@ static int arch_setup_late(struct xc_dom #else -static int arch_setup_early(struct xc_dom_image *dom) -{ - xc_dom_printf("%s: doing nothing\n", __FUNCTION__); - return 0; -} - -static int arch_setup_middle(struct xc_dom_image *dom) -{ - xc_dom_printf("%s: doing nothing\n", __FUNCTION__); - return 0; -} - -static int arch_setup_late(struct xc_dom_image *dom) +static int arch_setup_meminit(struct xc_dom_image *dom) +{ + xc_dom_printf("%s: doing nothing\n", __FUNCTION__); + return 0; +} + +static int arch_setup_bootearly(struct xc_dom_image *dom) +{ + xc_dom_printf("%s: doing nothing\n", __FUNCTION__); + return 0; +} + +static int arch_setup_bootlate(struct xc_dom_image *dom) { xc_dom_printf("%s: doing nothing\n", __FUNCTION__); return 0; @@ -423,7 +419,7 @@ int xc_dom_boot_mem_init(struct xc_dom_i xc_dom_printf("%s: called\n", __FUNCTION__); - if (0 != (rc = arch_setup_early(dom))) + if (0 != (rc = arch_setup_meminit(dom))) return rc; /* allocate guest memory */ @@ -438,7 +434,7 @@ int xc_dom_boot_mem_init(struct xc_dom_i return rc; } - if (0 != (rc = arch_setup_middle(dom))) + if (0 != (rc = arch_setup_bootearly(dom))) return rc; return 0; @@ -497,6 +493,10 @@ int xc_dom_boot_image(struct xc_dom_imag xc_dom_printf("%s: called\n", __FUNCTION__); + /* misc ia64 stuff*/ + if (0 != (rc = arch_setup_bootearly(dom))) + return rc; + /* collect some info */ domctl.cmd = XEN_DOMCTL_getdomaininfo; domctl.domain = dom->guest_domid; @@ -542,7 +542,7 @@ int xc_dom_boot_image(struct xc_dom_imag xc_dom_log_memory_footprint(dom); /* misc x86 stuff */ - if (0 != (rc = arch_setup_late(dom))) + if (0 != (rc = arch_setup_bootlate(dom))) return rc; /* let the vm run */ diff -r 3751a96ba021 -r c7633b8f3702 tools/libxc/xc_dom_ia64.c --- a/tools/libxc/xc_dom_ia64.c Thu Feb 01 11:50:48 2007 +0900 +++ b/tools/libxc/xc_dom_ia64.c Thu Feb 01 11:46:54 2007 +0900 @@ -26,11 +26,7 @@ static int alloc_magic_pages(struct xc_d /* allocate special pages */ dom->console_pfn = dom->total_pages -1; dom->xenstore_pfn = dom->total_pages -2; - - /* - * this is initialized by arch_setup_middle(). - * dom->start_info_pfn = dom->total_pages -3; - */ + dom->start_info_pfn = dom->total_pages -3; return 0; }