From: "John Weekes" Subject: Problem starting stubdoms past a domid of 257 + fix Date: Fri, 14 May 2010 15:02:04 -0700 Message-ID: <2D06015506BF4089B63E8AC3A3E57A1A@JohnPC> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0477558733==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com, Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============0477558733== Content-Type: multipart/alternative; boundary="----=_NextPart_000_020F_01CAF376.6A51D9C0" This is a multi-part message in MIME format. ------=_NextPart_000_020F_01CAF376.6A51D9C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm running Xen 4.0.1-rc1-pre (21122:7d1d4abd8b44). In this version, and = in all other Xen 3.5-unstable + versions that I've looked at, is this = function in XendDomainInfo.py: def getStubdomDomid(self): dom_list =3D xstransact.List('/local/domain') for d in dom_list: target =3D xstransact.Read('/local/domain/' + d + '/target') if target is not None and int(target) is self.domid : return int(d) return None The bolded line has a bug in it, unfortunately. This function is used in = domain destruction, and destruction works properly when a domain has a = stubdom, but only until it reaches a domid of around 257. Past that, it = breaks. This can be easily seen by simply starting a bunch of HVMs with = stubdoms (I tested by creating + destroying the same one, over and = over). What's interesting is that the function works at all -- "is" really does = not seem to be the right comparator to use here. The fix is to change that line to read: if target is not None and int(target) =3D=3D self.domid : I have patched all of my existing Xen installs, and tested the fix. This = might make a good candidate for inclusion in 4.0.1, as well as = xen-unstable (if it has the same piece of code). -John Weekes ------=_NextPart_000_020F_01CAF376.6A51D9C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I'm running Xen 4.0.1-rc1-pre = (21122:7d1d4abd8b44).=20 In this version, and in all other Xen 3.5-unstable + versions that I've = looked=20 at, is this function in XendDomainInfo.py:
    def=20 getStubdomDomid(self):
        = dom_list =3D=20 xstransact.List('/local/domain')
      &= nbsp;=20 for d in=20 dom_list:
          =  =20 target =3D xstransact.Read('/local/domain/' + d +=20 '/target')
        &nb= sp;  =20 if target is not None and int(target) is self.domid=20 :
          = ;     =20 return int(d)
        return=20 None
The bolded line has a bug in it,=20 unfortunately. This function is used in domain destruction, and = destruction=20 works properly when a domain has a stubdom, but only until it reaches a = domid of=20 around 257. Past that, it breaks. This can be easily seen by=20 simply starting a bunch of HVMs with stubdoms (I tested by creating = +=20 destroying the same one, over and over).
 
What's interesting is that the function = works at=20 all -- "is" really does not seem to be the right comparator to use=20 here.
 
The fix is to change that line to=20 read:
          =   if=20 target is not None and int(target) =3D=3D self.domid = :
I have patched all of my existing Xen = installs, and=20 tested the fix. This might make a good candidate for inclusion in 4.0.1, = as well=20 as xen-unstable (if it has the same piece of code).
 
-John Weekes
------=_NextPart_000_020F_01CAF376.6A51D9C0-- --===============0477558733== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0477558733==--