ia64/xen-unstable

view tools/python/xen/xend/XendDmesg.py @ 12725:36fe7ca48e54

Tidy up the creation of directories that Xend needs. This avoids potential
races in this creation.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Dec 01 11:32:32 2006 +0000 (2006-12-01)
parents 87b520c30cb2
children c9ac275f8985
line source
1 #============================================================================
2 # This library is free software; you can redistribute it and/or
3 # modify it under the terms of version 2.1 of the GNU Lesser General Public
4 # License as published by the Free Software Foundation.
5 #
6 # This library is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 # Lesser General Public License for more details.
10 #
11 # You should have received a copy of the GNU Lesser General Public
12 # License along with this library; if not, write to the Free Software
13 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14 #============================================================================
15 # Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
16 #============================================================================
18 """Get dmesg output for this node.
19 """
21 import xen.lowlevel.xc
23 class XendDmesg:
24 def __init__(self):
25 self.xc = xen.lowlevel.xc.xc()
27 def info(self):
28 return self.xc.readconsolering()
30 def clear(self):
31 self.xc.readconsolering(True)
33 def instance():
34 global inst
35 try:
36 inst
37 except:
38 inst = XendDmesg()
39 return inst