diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-08-28 09:40:10 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-08-28 09:40:10 +0100 |
commit | 2e8459a4fcb153bb6f9199a97e85bf17bd2c1b12 (patch) | |
tree | 43aaa7a45eb73a283d42b6679c202ae50f08e7c3 /tools/libxc/xc_minios.c | |
parent | 8a68b82ff1ad7bcb3cff4f0543164cdab91df072 (diff) | |
download | xen-2e8459a4fcb153bb6f9199a97e85bf17bd2c1b12.tar.gz xen-2e8459a4fcb153bb6f9199a97e85bf17bd2c1b12.tar.bz2 xen-2e8459a4fcb153bb6f9199a97e85bf17bd2c1b12.zip |
stubdom: make xc_map_foreign_ranges use malloc instead of stack space
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_minios.c')
-rw-r--r-- | tools/libxc/xc_minios.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c index be81c15ee1..a4e32ff078 100644 --- a/tools/libxc/xc_minios.c +++ b/tools/libxc/xc_minios.c @@ -80,9 +80,10 @@ void *xc_map_foreign_ranges(int xc_handle, uint32_t dom, size_t size, int prot, size_t chunksize, privcmd_mmap_entry_t entries[], int nentries) { - unsigned long mfns[size / PAGE_SIZE]; + unsigned long *mfns; int i, j, n; unsigned long pt_prot = 0; + void *ret; #ifdef __ia64__ /* TODO */ #else @@ -92,12 +93,16 @@ void *xc_map_foreign_ranges(int xc_handle, uint32_t dom, pt_prot = L1_PROT; #endif + mfns = malloc((size / PAGE_SIZE) * sizeof(*mfns)); + n = 0; for (i = 0; i < nentries; i++) for (j = 0; j < chunksize / PAGE_SIZE; j++) mfns[n++] = entries[i].mfn + j; - return map_frames_ex(mfns, n, 1, 0, 1, dom, 0, pt_prot); + ret = map_frames_ex(mfns, n, 1, 0, 1, dom, 0, pt_prot); + free(mfns); + return ret; } |