ia64/xen-unstable
changeset 14508:265e257388b5
[POWERPC][LIBXC] Remove Prose builder.
It is no longer being maintained and probably shouldn't have existed in the
first place, since it was almost identical to xc_linux_build.c.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
It is no longer being maintained and probably shouldn't have existed in the
first place, since it was almost identical to xc_linux_build.c.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author | Hollis Blanchard <hollisb@us.ibm.com> |
---|---|
date | Wed Mar 21 17:03:00 2007 -0500 (2007-03-21) |
parents | ed84ed49bb81 |
children | 2c087916aaba |
files | tools/libxc/powerpc64/Makefile tools/libxc/powerpc64/xc_prose_build.c tools/python/xen/lowlevel/xc/xc.c tools/python/xen/xend/image.py |
line diff
1.1 --- a/tools/libxc/powerpc64/Makefile Wed Mar 21 17:02:59 2007 -0500 1.2 +++ b/tools/libxc/powerpc64/Makefile Wed Mar 21 17:03:00 2007 -0500 1.3 @@ -1,7 +1,6 @@ 1.4 GUEST_SRCS-y += powerpc64/flatdevtree.c 1.5 GUEST_SRCS-y += powerpc64/mk_flatdevtree.c 1.6 GUEST_SRCS-y += powerpc64/xc_linux_build.c 1.7 -GUEST_SRCS-y += powerpc64/xc_prose_build.c 1.8 GUEST_SRCS-y += powerpc64/utils.c 1.9 1.10 CTRL_SRCS-y += powerpc64/xc_memory.c
2.1 --- a/tools/libxc/powerpc64/xc_prose_build.c Wed Mar 21 17:02:59 2007 -0500 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,215 +0,0 @@ 2.4 -/* 2.5 - * This program is free software; you can redistribute it and/or modify 2.6 - * it under the terms of the GNU General Public License as published by 2.7 - * the Free Software Foundation; either version 2 of the License, or 2.8 - * (at your option) any later version. 2.9 - * 2.10 - * This program is distributed in the hope that it will be useful, 2.11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 2.12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2.13 - * GNU General Public License for more details. 2.14 - * 2.15 - * You should have received a copy of the GNU General Public License 2.16 - * along with this program; if not, write to the Free Software 2.17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 2.18 - * 2.19 - * Copyright IBM Corporation 2006, 2007 2.20 - * 2.21 - * Authors: Hollis Blanchard <hollisb@us.ibm.com> 2.22 - * Jonathan Appavoo <jappavoo@us.ibm.com> 2.23 - */ 2.24 - 2.25 -#include <stdio.h> 2.26 -#include <stdint.h> 2.27 -#include <stdlib.h> 2.28 -#include <string.h> 2.29 -#include <unistd.h> 2.30 -#include <fcntl.h> 2.31 -#include <sys/types.h> 2.32 -#include <inttypes.h> 2.33 - 2.34 -#include <xen/xen.h> 2.35 -#include <xen/memory.h> 2.36 -#include <xc_private.h> 2.37 -#include <xg_private.h> 2.38 -#include <xenctrl.h> 2.39 - 2.40 -#include "utils.h" 2.41 - 2.42 -#define INITRD_ADDR (24UL << 20) 2.43 - 2.44 -static int init_boot_vcpu( 2.45 - int xc_handle, 2.46 - int domid, 2.47 - struct domain_setup_info *dsi, 2.48 - unsigned long kern_addr) 2.49 -{ 2.50 - vcpu_guest_context_t ctxt; 2.51 - int rc; 2.52 - 2.53 - memset(&ctxt.user_regs, 0x55, sizeof(ctxt.user_regs)); 2.54 - ctxt.user_regs.pc = dsi->v_kernentry; 2.55 - ctxt.user_regs.msr = 0; 2.56 - ctxt.user_regs.gprs[1] = 0; /* Linux uses its own stack */ 2.57 - ctxt.user_regs.gprs[3] = 0; 2.58 - ctxt.user_regs.gprs[4] = kern_addr; 2.59 - ctxt.user_regs.gprs[5] = 0; /* reserved for specifying OF handler */ 2.60 - /* There is a buggy kernel that does not zero the "local_paca", so 2.61 - * we must make sure this register is 0 */ 2.62 - ctxt.user_regs.gprs[13] = 0; 2.63 - 2.64 - DPRINTF("xc_vcpu_setvcpucontext:\n" 2.65 - " pc 0x%016"PRIx64", msr 0x%016"PRIx64"\n" 2.66 - " r1-5 %016"PRIx64" %016"PRIx64" %016"PRIx64" %016"PRIx64 2.67 - " %016"PRIx64"\n", 2.68 - ctxt.user_regs.pc, ctxt.user_regs.msr, 2.69 - ctxt.user_regs.gprs[1], 2.70 - ctxt.user_regs.gprs[2], 2.71 - ctxt.user_regs.gprs[3], 2.72 - ctxt.user_regs.gprs[4], 2.73 - ctxt.user_regs.gprs[5]); 2.74 - rc = xc_vcpu_setcontext(xc_handle, domid, 0, &ctxt); 2.75 - if (rc < 0) 2.76 - perror("setdomaininfo"); 2.77 - 2.78 - return rc; 2.79 -} 2.80 - 2.81 -static int load_initrd( 2.82 - int xc_handle, 2.83 - int domid, 2.84 - xen_pfn_t *page_array, 2.85 - const char *initrd_path, 2.86 - unsigned long *base, 2.87 - unsigned long *len) 2.88 -{ 2.89 - uint8_t *initrd_img; 2.90 - int rc = -1; 2.91 - 2.92 - /* load the initrd file */ 2.93 - initrd_img = load_file(initrd_path, len); 2.94 - if (initrd_img == NULL) 2.95 - return -1; 2.96 - 2.97 - DPRINTF("copying initrd to 0x%lx[0x%lx]\n", INITRD_ADDR, *len); 2.98 - if (install_image(xc_handle, domid, page_array, initrd_img, INITRD_ADDR, 2.99 - *len)) 2.100 - goto out; 2.101 - 2.102 - *base = INITRD_ADDR; 2.103 - rc = 0; 2.104 - 2.105 -out: 2.106 - free(initrd_img); 2.107 - return rc; 2.108 -} 2.109 - 2.110 -static unsigned long create_start_info( 2.111 - start_info_t *start_info, 2.112 - unsigned int console_evtchn, unsigned int store_evtchn, 2.113 - unsigned long nr_pages, unsigned long rma_pages, const char *cmdline) 2.114 -{ 2.115 - unsigned long start_info_addr; 2.116 - uint64_t rma_top; 2.117 - 2.118 - memset(start_info, 0, sizeof(*start_info)); 2.119 - snprintf(start_info->magic, sizeof(start_info->magic), 2.120 - "xen-%d.%d-powerpc64HV", 3, 0); 2.121 - 2.122 - rma_top = rma_pages << PAGE_SHIFT; 2.123 - DPRINTF("RMA top = 0x%"PRIX64"\n", rma_top); 2.124 - 2.125 - start_info->nr_pages = nr_pages; 2.126 - start_info->shared_info = rma_top - PAGE_SIZE; 2.127 - start_info->store_mfn = (rma_top >> PAGE_SHIFT) - 2; 2.128 - start_info->store_evtchn = store_evtchn; 2.129 - start_info->console.domU.mfn = (rma_top >> PAGE_SHIFT) - 3; 2.130 - start_info->console.domU.evtchn = console_evtchn; 2.131 - strncpy((char *)start_info->cmd_line, cmdline, MAX_GUEST_CMDLINE); 2.132 - /* just in case we truncated cmdline with strncpy add 0 at the end */ 2.133 - start_info->cmd_line[MAX_GUEST_CMDLINE-1]=0; 2.134 - start_info_addr = rma_top - 4*PAGE_SIZE; 2.135 - 2.136 - return start_info_addr; 2.137 -} 2.138 - 2.139 -static void free_page_array(xen_pfn_t *page_array) 2.140 -{ 2.141 - free(page_array); 2.142 -} 2.143 - 2.144 -int xc_prose_build(int xc_handle, 2.145 - uint32_t domid, 2.146 - unsigned int mem_mb, 2.147 - const char *image_name, 2.148 - const char *initrd_name, 2.149 - const char *cmdline, 2.150 - const char *features, 2.151 - unsigned long flags, 2.152 - unsigned int store_evtchn, 2.153 - unsigned long *store_mfn, 2.154 - unsigned int console_evtchn, 2.155 - unsigned long *console_mfn) 2.156 -{ 2.157 - start_info_t start_info; 2.158 - struct domain_setup_info dsi; 2.159 - xen_pfn_t *page_array = NULL; 2.160 - unsigned long nr_pages; 2.161 - unsigned long kern_addr; 2.162 - unsigned long initrd_base = 0; 2.163 - unsigned long initrd_len = 0; 2.164 - unsigned long start_info_addr; 2.165 - unsigned long rma_pages; 2.166 - int rc = 0; 2.167 - 2.168 - DPRINTF("%s\n", __func__); 2.169 - 2.170 - DPRINTF("cmdline=%s\n", cmdline); 2.171 - 2.172 - nr_pages = mem_mb << (20 - PAGE_SHIFT); 2.173 - DPRINTF("nr_pages 0x%lx\n", nr_pages); 2.174 - 2.175 - rma_pages = (1 << 26) >> PAGE_SHIFT; /* 64 MB */ 2.176 - 2.177 - if (get_rma_page_array(xc_handle, domid, &page_array, rma_pages)) { 2.178 - rc = -1; 2.179 - goto out; 2.180 - } 2.181 - 2.182 - DPRINTF("loading image '%s'\n", image_name); 2.183 - if (load_elf_kernel(xc_handle, domid, image_name, &dsi, page_array)) { 2.184 - rc = -1; 2.185 - goto out; 2.186 - } 2.187 - kern_addr = 0; 2.188 - 2.189 - if (initrd_name && initrd_name[0] != '\0') { 2.190 - DPRINTF("loading initrd '%s'\n", initrd_name); 2.191 - if (load_initrd(xc_handle, domid, page_array, initrd_name, 2.192 - &initrd_base, &initrd_len)) { 2.193 - rc = -1; 2.194 - goto out; 2.195 - } 2.196 - } 2.197 - 2.198 - /* start_info stuff: about to be removed */ 2.199 - start_info_addr = create_start_info(&start_info, console_evtchn, 2.200 - store_evtchn, nr_pages, 2.201 - rma_pages, cmdline); 2.202 - *console_mfn = page_array[start_info.console.domU.mfn]; 2.203 - *store_mfn = page_array[start_info.store_mfn]; 2.204 - if (install_image(xc_handle, domid, page_array, &start_info, 2.205 - start_info_addr, sizeof(start_info_t))) { 2.206 - rc = -1; 2.207 - goto out; 2.208 - } 2.209 - 2.210 - if (init_boot_vcpu(xc_handle, domid, &dsi, kern_addr)) { 2.211 - rc = -1; 2.212 - goto out; 2.213 - } 2.214 - 2.215 -out: 2.216 - free_page_array(page_array); 2.217 - return rc; 2.218 -}
3.1 --- a/tools/python/xen/lowlevel/xc/xc.c Wed Mar 21 17:02:59 2007 -0500 3.2 +++ b/tools/python/xen/lowlevel/xc/xc.c Wed Mar 21 17:03:00 2007 -0500 3.3 @@ -1042,46 +1042,6 @@ static PyObject *pyxc_alloc_real_mode_ar 3.4 Py_INCREF(zero); 3.5 return zero; 3.6 } 3.7 - 3.8 -static PyObject *pyxc_prose_build(XcObject *self, 3.9 - PyObject *args, 3.10 - PyObject *kwds) 3.11 -{ 3.12 - uint32_t dom; 3.13 - char *image, *ramdisk = NULL, *cmdline = "", *features = NULL; 3.14 - int flags = 0; 3.15 - int store_evtchn, console_evtchn; 3.16 - unsigned int mem_mb; 3.17 - unsigned long store_mfn = 0; 3.18 - unsigned long console_mfn = 0; 3.19 - int unused; 3.20 - 3.21 - static char *kwd_list[] = { "dom", "store_evtchn", 3.22 - "console_evtchn", "image", "memsize", 3.23 - /* optional */ 3.24 - "ramdisk", "cmdline", "flags", 3.25 - "features", NULL }; 3.26 - 3.27 - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssis#", kwd_list, 3.28 - &dom, &store_evtchn, &mem_mb, 3.29 - &console_evtchn, &image, 3.30 - /* optional */ 3.31 - &ramdisk, &cmdline, &flags, 3.32 - &features, &unused) ) 3.33 - return NULL; 3.34 - 3.35 - if ( xc_prose_build(self->xc_handle, dom, mem_mb, image, 3.36 - ramdisk, cmdline, features, flags, 3.37 - store_evtchn, &store_mfn, 3.38 - console_evtchn, &console_mfn) != 0 ) { 3.39 - if (!errno) 3.40 - errno = EINVAL; 3.41 - return pyxc_error_to_exception(); 3.42 - } 3.43 - return Py_BuildValue("{s:i,s:i}", 3.44 - "store_mfn", store_mfn, 3.45 - "console_mfn", console_mfn); 3.46 -} 3.47 #endif /* powerpc */ 3.48 3.49 static PyMethodDef pyxc_methods[] = { 3.50 @@ -1428,17 +1388,6 @@ static PyMethodDef pyxc_methods[] = { 3.51 " dom [int]: Identifier of domain.\n" 3.52 " log [int]: Specifies the area's size.\n" 3.53 "Returns: [int] 0 on success; -1 on error.\n" }, 3.54 - 3.55 - { "arch_prose_build", 3.56 - (PyCFunction)pyxc_prose_build, 3.57 - METH_VARARGS | METH_KEYWORDS, "\n" 3.58 - "Build a new Linux guest OS.\n" 3.59 - " dom [int]: Identifier of domain to build into.\n" 3.60 - " image [str]: Name of kernel image file. May be gzipped.\n" 3.61 - " ramdisk [str, n/a]: Name of ramdisk file, if any.\n" 3.62 - " cmdline [str, n/a]: Kernel parameters, if any.\n\n" 3.63 - " vcpus [int, 1]: Number of Virtual CPUS in domain.\n\n" 3.64 - "Returns: [int] 0 on success; -1 on error.\n" }, 3.65 #endif /* __powerpc */ 3.66 3.67 { NULL, NULL, 0, NULL }
4.1 --- a/tools/python/xen/xend/image.py Wed Mar 21 17:02:59 2007 -0500 4.2 +++ b/tools/python/xen/xend/image.py Wed Mar 21 17:03:00 2007 -0500 4.3 @@ -229,35 +229,6 @@ class PPC_LinuxImageHandler(LinuxImageHa 4.4 4.5 4.6 4.7 -class PPC_ProseImageHandler(PPC_LinuxImageHandler): 4.8 - 4.9 - ostype = "prose" 4.10 - 4.11 - def buildDomain(self): 4.12 - store_evtchn = self.vm.getStorePort() 4.13 - console_evtchn = self.vm.getConsolePort() 4.14 - 4.15 - mem_mb = self.getRequiredInitialReservation() / 1024 4.16 - 4.17 - log.debug("dom = %d", self.vm.getDomid()) 4.18 - log.debug("memsize = %d", mem_mb) 4.19 - log.debug("image = %s", self.kernel) 4.20 - log.debug("store_evtchn = %d", store_evtchn) 4.21 - log.debug("console_evtchn = %d", console_evtchn) 4.22 - log.debug("cmdline = %s", self.cmdline) 4.23 - log.debug("ramdisk = %s", self.ramdisk) 4.24 - log.debug("vcpus = %d", self.vm.getVCpuCount()) 4.25 - log.debug("features = %s", self.vm.getFeatures()) 4.26 - 4.27 - return xc.arch_prose_build(dom = self.vm.getDomid(), 4.28 - memsize = mem_mb, 4.29 - image = self.kernel, 4.30 - store_evtchn = store_evtchn, 4.31 - console_evtchn = console_evtchn, 4.32 - cmdline = self.cmdline, 4.33 - ramdisk = self.ramdisk, 4.34 - features = self.vm.getFeatures()) 4.35 - 4.36 class HVMImageHandler(ImageHandler): 4.37 4.38 ostype = "hvm" 4.39 @@ -616,7 +587,6 @@ class X86_Linux_ImageHandler(LinuxImageH 4.40 _handlers = { 4.41 "powerpc": { 4.42 "linux": PPC_LinuxImageHandler, 4.43 - "prose": PPC_ProseImageHandler, 4.44 }, 4.45 "ia64": { 4.46 "linux": LinuxImageHandler,