WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] That xenstored console leak...

To: John Levon <levon@xxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] That xenstored console leak...
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Fri, 11 Jan 2008 19:24:56 +0000
Delivery-date: Fri, 11 Jan 2008 11:25:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080111173914.GA24773@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AchUh6Xb5HIXjMB6Edy3VAAWy6hiGQ==
Thread-topic: [Xen-devel] That xenstored console leak...
User-agent: Microsoft-Entourage/11.3.6.070618
Shouldn't the transaction be wrapped in a 'while True' with a break or
return on t.commit() returning True? Otherwise you are not correctly
handling transaction failure. Please fix and resubmit.

 Thanks,
 Keir

On 11/1/08 17:39, "John Levon" <levon@xxxxxxxxxxxxxxxxx> wrote:

> 
> Here's what I'm using to fix it in 3.1. Obviously too risky for 3.2 now,
> and anyway, there's a much more serious problem in 3.2 - entire /vm/
> entries are leaked on domU reboot! I haven't got round to debugging that
> one yet since it's not present in 3.1, but it really should be fixed
> 
> regards
> john
> 
> 
> # HG changeset patch
> # User john.levon@xxxxxxx
> # Date 1200028523 28800
> # Node ID 8a26f9a3f573a7c3b970f4349dd47fd4bf851df1
> # Parent  c594cafb7e427e3b1f732a37c4b521f1e98dd08d
> Cleanup xenstore after console device teardown
> 
> After the changes in 13616:b111908dd70b, DevController was leaking
> xenstore entries every time we took down a console device, as there was
> no equivalent to 'xenstore-rm -t' used in the hotplug scripts for "real"
> devices. Implement the moral equivalent whenever removal is forced.
> 
> Signed-off-by: John Levon <john.levon@xxxxxxx>
> 
> diff --git a/tools/python/xen/xend/server/DevController.py
> b/tools/python/xen/xend/server/DevController.py
> --- a/tools/python/xen/xend/server/DevController.py
> +++ b/tools/python/xen/xend/server/DevController.py
> @@ -231,11 +231,21 @@ class DevController:
>          self.writeBackend(dev, 'state', str(xenbusState['Closing']))
>  
>          if force:
> -            frontpath = self.frontendPath(dev)
> -            backpath = xstransact.Read(frontpath, "backend")
> -            if backpath:
> -                xstransact.Remove(backpath)
> -            xstransact.Remove(frontpath)
> +            try:
> +                frontpath = self.frontendPath(dev)
> +                t = xstransact()
> +                backpath = t.read("%s/backend" % frontpath)
> +                if backpath:
> +                    t.remove(backpath)
> +                    # tidy up empty directories
> +                    while not t.list(backpath):
> +                        t.remove(backpath)
> +                        backpath = os.path.dirname(backpath)
> +                t.remove(frontpath)
> +                t.commit()
> +            except:
> +                t.abort()
> +                raise
>  
>          self.vm._removeVm("device/%s/%d" % (self.deviceClass, dev))
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel