diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-06-01 14:15:48 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-06-01 14:15:48 +0100 |
commit | d06a984487230b6e078e30f2cea26b3baf937efc (patch) | |
tree | 97679128014fe5f84e3c740345d18b43bf301984 /tools/libxc/xenguest.h | |
parent | 1472f8177f8ec6d81b471d678cf22e04c36e1a2a (diff) | |
download | xen-d06a984487230b6e078e30f2cea26b3baf937efc.tar.gz xen-d06a984487230b6e078e30f2cea26b3baf937efc.tar.bz2 xen-d06a984487230b6e078e30f2cea26b3baf937efc.zip |
libxc: Exchange a page for PV guest
This patch support exchange a page for a suspended PV guest from user
space.
The basic idea to offline a page is:
1) mark a page offline pending
2) If the page is owned by a HVM domain, user have to live migrate it.
In future, with stub-domain support, we can also exchange the page
without migration.
3) If the page is owned by a PV domain, we will try to exchange the
offline pending page to a new one and free the old page.
This patch achieves item 3.
The method to exchange the offline pending page for PV domain is:
1) Suspend the guest.
2) If the page is being granted out, return with offline pending.
3) Get a copy for the content
4) Scan all page table page to see if any reference to the offending
page, if yes, make the entry to be non-present to reduce the reference
count.
5) After update all page tables, user space tools will try to exchange
the old page. If the new mfn has no reference anymore (i.e.
count_info & count_mask =3D 1), the exchange will allocate a new page,
update the m2p and return success, otherwise it will return fail.
6) If step 5 is success, user space tools will update the content of
the new page change the p2m table, and change all entries scaned in
step 4 to point to new entry.
if step failed, it will try to undo step 4 to revert page table.
7) Resume the guest.
Please refer to thread in
http://www.mailinglistarchive.com/xen-devel@lists.xensource.com/msg63084.html
for more information.
Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Diffstat (limited to 'tools/libxc/xenguest.h')
-rw-r--r-- | tools/libxc/xenguest.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h index cd55f89cca..220db7061c 100644 --- a/tools/libxc/xenguest.h +++ b/tools/libxc/xenguest.h @@ -163,6 +163,8 @@ int xc_mark_page_offline(int xc, unsigned long start, int xc_query_page_offline_status(int xc, unsigned long start, unsigned long end, uint32_t *status); +int xc_exchange_page(int xc_handle, int domid, xen_pfn_t mfn); + /** * This function map m2p table |