From: Rik van Riel <riel@redhat.com> Subject: [PATCH][RHEL5 Xen] make ballooning work right Date: Mon, 11 Dec 2006 21:13:35 -0500 Bugzilla: 212069 Message-Id: <457E104F.3030600@redhat.com> Changelog: Xen: make ballooning work right These patches (kernel and hypervisor) make the memory sizing of Xen domains work right, by letting the Xen guest kernel know at boot time how much memory it could get in the future. This allows one to boot up a Xen guest with (eg.) 200MB and later grow it to 500MB, by specifying the "maxmem=500" in the domain config file. The accompanying tools patch (for the xen RPM) will be posted just to virtualist. Fixes bug 212069 -- Politics is the struggle between those who want to make their country the best in the world, and those who believe it already is. Each group calls the other unpatriotic. diff -r 8beecb8c5ae2 -r df5fa63490f4 linux/include/xen/interface/memory.h --- linux/include/xen/interface/memory.h Fri Dec 08 11:08:26 2006 +0000 +++ linux/include/xen/interface/memory.h Fri Dec 08 11:30:30 2006 +0000 @@ -222,7 +222,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_translate_gp /* * Returns the pseudo-physical memory map as it was when the domain - * was started. + * was started (specified by XENMEM_set_memory_map). + * arg == addr of xen_memory_map_t. */ #define XENMEM_memory_map 9 struct xen_memory_map { @@ -245,8 +246,22 @@ DEFINE_XEN_GUEST_HANDLE(xen_memory_map_t /* * Returns the real physical memory map. Passes the same structure as * XENMEM_memory_map. + * arg == addr of xen_memory_map_t. */ #define XENMEM_machine_memory_map 10 + +/* + * Set the pseudo-physical memory map of a domain, as returned by + * XENMEM_memory_map. + * arg == addr of xen_foreign_memory_map_t. + */ +#define XENMEM_set_memory_map 13 +struct xen_foreign_memory_map { + domid_t domid; + struct xen_memory_map map; +}; +typedef struct xen_foreign_memory_map xen_foreign_memory_map_t; +DEFINE_XEN_GUEST_HANDLE(xen_foreign_memory_map_t); #endif /* __XEN_PUBLIC_MEMORY_H__ */