aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenmgr/lib/XendNode.py
blob: 9be3d642bce63fb2fb8d004548fdb15baf7ee1d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>

"""Handler for node operations.
 Has some persistent state:
 - logs
 - notification urls

"""

import Xc

class XendNodeInfo:
    """Node information record.
    """

    def __init__(self):
        pass

class XendNode:

    def __init__(self):
        self.xc = Xc.new()

    def shutdown(self):
        return 0

    def reboot(self):
        return 0

    def notify(self, uri):
        return 0
    
    def cpu_bvt_slice_set(self, slice):
        ret = 0
        #ret = self.xc.bvtsched_global_set(ctx_allow=slice)
        return ret

    def cpu_bvt_slice_get(self, slice):
        ret = 0
        #ret = self.xc.bvtsched_global_get()
        return ret
    
    def cpu_rrobin_slice_set(self, slice):
        ret = 0
        #ret = self.xc.rrobin_global_set(slice)
        return ret

def instance():
    global inst
    try:
        inst
    except:
        inst = XendNode()
    return inst