aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_dom_compat_linux.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-12-02 08:51:12 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-12-02 08:51:12 +0000
commite45215a3fe22c63f9a7d13dd1a73020e10a9e6de (patch)
treec04062ddc0d380f0d6efb60bf122119ac97c069b /tools/libxc/xc_dom_compat_linux.c
parentda583c807c223b6532c8cf2791057c330011964a (diff)
downloadxen-e45215a3fe22c63f9a7d13dd1a73020e10a9e6de.tar.gz
xen-e45215a3fe22c63f9a7d13dd1a73020e10a9e6de.tar.bz2
xen-e45215a3fe22c63f9a7d13dd1a73020e10a9e6de.zip
xend: Memory pool for pv guest on systems with >128G memory
The main idea of this patch is: 1) The admin sets aside some memory below 128G for 32-bit paravirtual domain creation (via dom0_mem=-<value> in kernel comand line). 2) The admin also explicitly states to the tools (i..e xend) how much memory is supposed to be left untouched by 64-bit domains 3) If a 32-bit pv DomU gets created, no ballooning ought to be necessary (since if it is, no guarantee can be made about the address range of the memory ballooned out), and memory gets allocated from the reserved range. 4) Upon 64-bit (or 32-bit HVM or HVM) DomU creation, the tools determine the amount of memory to be ballooned out of Dom0 by adding the amount needed for the new guest and the amount still in the reserved pool (and then of course subtracting the total amount of memory the hypervisor has available for guest use). Signed-off-by: james song (wei) <jsong@novell.com>
Diffstat (limited to 'tools/libxc/xc_dom_compat_linux.c')
-rw-r--r--tools/libxc/xc_dom_compat_linux.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index c00cd5abcd..ef809627f8 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -122,6 +122,28 @@ int xc_linux_build(int xc_handle, uint32_t domid,
xc_dom_release(dom);
return rc;
}
+int xc_get_bit_size(const char *image_name, const char *cmdline,
+ const char *features, int *bit_size)
+{
+ struct xc_dom_image *dom;
+ int rc;
+ *bit_size = 0;
+ dom = xc_dom_allocate(cmdline, features);
+ if ( (rc = xc_dom_kernel_file(dom, image_name)) != 0 )
+ goto out;
+ if ( (rc = xc_dom_parse_image(dom)) != 0 )
+ goto out;
+ if( dom->guest_type != NULL){
+ if(strstr(dom->guest_type, "x86_64") != NULL)
+ *bit_size = X86_64_B_SIZE; //64bit Guest
+ if(strstr(dom->guest_type, "x86_32") != NULL)
+ *bit_size = X86_32_B_SIZE; //32bit Guest
+ }
+
+out:
+ xc_dom_release(dom);
+ return rc;
+}
int xc_dom_linux_build(int xc_handle,
struct xc_dom_image *dom,