ia64/xen-unstable

changeset 10136:13d6d993d797

[IA64] Work around auto-ballooning changes.
Original patch from Kevin Tian at Intel.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon May 22 17:30:25 2006 +0100 (2006-05-22)
parents dbcb8acc8f59
children 72c5d8206d48
files tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Mon May 22 17:03:24 2006 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Mon May 22 17:30:25 2006 +0100
     1.3 @@ -29,6 +29,7 @@ import logging
     1.4  import string
     1.5  import time
     1.6  import threading
     1.7 +import os
     1.8  
     1.9  import xen.lowlevel.xc
    1.10  from xen.util import asserts
    1.11 @@ -1264,7 +1265,14 @@ class XendDomainInfo:
    1.12              m = self.image.getDomainMemory(self.info['memory'] * 1024)
    1.13              balloon.free(m)
    1.14              xc.domain_setmaxmem(self.domid, m)
    1.15 -            xc.domain_memory_increase_reservation(self.domid, self.info['memory'] * 1024, 0, 0)
    1.16 +
    1.17 +            init_reservation = self.info['memory'] * 1024
    1.18 +            if os.uname()[4] == 'ia64':
    1.19 +                # Workaround until ia64 properly supports ballooning.
    1.20 +                init_reservation = m
    1.21 +
    1.22 +            xc.domain_memory_increase_reservation(self.domid, init_reservation,
    1.23 +                                                  0, 0)
    1.24  
    1.25              self.createChannels()
    1.26  
     2.1 --- a/tools/python/xen/xend/image.py	Mon May 22 17:03:24 2006 +0100
     2.2 +++ b/tools/python/xen/xend/image.py	Mon May 22 17:30:25 2006 +0100
     2.3 @@ -144,10 +144,13 @@ class ImageHandler:
     2.4  
     2.5      def getDomainMemory(self, mem_kb):
     2.6          """@return The memory required, in KiB, by the domain to store the
     2.7 -        given amount, also in KiB.  This is normally just mem, but if HVM is
     2.8 -        supported, keep a little extra free."""
     2.9 -        if 'hvm' in xc.xeninfo()['xen_caps']:
    2.10 -            mem_kb += 4*1024;
    2.11 +        given amount, also in KiB."""
    2.12 +        if os.uname()[4] != 'ia64':
    2.13 +            # A little extra because auto-ballooning is broken w.r.t. HVM
    2.14 +            # guests. Also, slack is necessary for live migration since that
    2.15 +            # uses shadow page tables.
    2.16 +            if 'hvm' in xc.xeninfo()['xen_caps']:
    2.17 +                mem_kb += 4*1024;
    2.18          return mem_kb
    2.19  
    2.20      def buildDomain(self):