source: trunk/packages/xen-3.1/xen-3.1/tools/python/xen/xend/XendDmesg.py @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 1.3 KB
Line 
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# Copyright (C) 2007       XenSource Inc.
17#============================================================================
18
19"""Get dmesg output for this node.
20"""
21
22import xen.lowlevel.xc
23
24class XendDmesg:
25    def __init__(self):
26        self.xc = xen.lowlevel.xc.xc()
27
28    def info(self):
29        return self.xc.readconsolering()
30
31    def clear(self):
32        return self.xc.readconsolering(True)
33
34def instance():
35    global inst
36    try:
37        inst
38    except:
39        inst = XendDmesg()
40    return inst
41
Note: See TracBrowser for help on using the repository browser.