ia64/xen-unstable
changeset 3288:1a1036639bf5
bitkeeper revision 1.1159.1.481 (41c07f85G2hWDdcToBM9klxqtewYlQ)
Bound number of vcpus by XEN_VCPUS environment variable in xend environment.
Bound number of vcpus by XEN_VCPUS environment variable in xend environment.
author | cl349@arcadians.cl.cam.ac.uk |
---|---|
date | Wed Dec 15 18:16:37 2004 +0000 (2004-12-15) |
parents | 545088ce72b5 |
children | 86e3ae8351cd |
files | tools/libxc/xc_linux_build.c |
line diff
1.1 --- a/tools/libxc/xc_linux_build.c Wed Dec 15 18:14:19 2004 +0000 1.2 +++ b/tools/libxc/xc_linux_build.c Wed Dec 15 18:16:37 2004 +0000 1.3 @@ -127,6 +127,8 @@ static int setup_guestos(int xc_handle, 1.4 unsigned long vpt_end; 1.5 unsigned long v_end; 1.6 1.7 + char *n_vcpus; 1.8 + 1.9 memset(&dsi, 0, sizeof(struct domain_setup_info)); 1.10 1.11 rc = parseelfimage(image, image_size, &dsi); 1.12 @@ -335,7 +337,11 @@ static int setup_guestos(int xc_handle, 1.13 /* Mask all upcalls... */ 1.14 for ( i = 0; i < MAX_VIRT_CPUS; i++ ) 1.15 shared_info->vcpu_data[i].evtchn_upcall_mask = 1; 1.16 - shared_info->n_vcpu = 32; 1.17 + n_vcpus = getenv("XEN_VCPUS"); 1.18 + if ( n_vcpus ) 1.19 + shared_info->n_vcpu = atoi(n_vcpus); 1.20 + else 1.21 + shared_info->n_vcpu = 1; 1.22 munmap(shared_info, PAGE_SIZE); 1.23 1.24 /* Send the page update requests down to the hypervisor. */