コード例 #1
0
ファイル: image.py プロジェクト: Hearen/OnceServer
    def setCpuid(self):
        xc.domain_set_policy_cpuid(self.vm.getDomid())

        if self.cpuid is not None:
            cpuid = self.cpuid
            transformed = {}
            for sinput, regs in cpuid.iteritems():
                inputs = sinput.split(',')
                input = long(inputs[0])
                sub_input = None
                if len(inputs) == 2:
                    sub_input = long(inputs[1])
                t = xc.domain_set_cpuid(self.vm.getDomid(),
                                        input, sub_input, regs)
                transformed[sinput] = t
            self.cpuid = transformed

        if self.cpuid_check is not None:
            cpuid_check = self.cpuid_check
            transformed = {}
            for sinput, regs_check in cpuid_check.iteritems():
                inputs = sinput.split(',')
                input = long(inputs[0])
                sub_input = None
                if len(inputs) == 2:
                    sub_input = long(inputs[1])
                t = xc.domain_check_cpuid(input, sub_input, regs_check)
                transformed[sinput] = t
            self.cpuid_check = transformed
コード例 #2
0
    def setCpuid(self):
        xc.domain_set_policy_cpuid(self.vm.getDomid())

        if self.cpuid is not None:
            cpuid = self.cpuid
            transformed = {}
            for sinput, regs in cpuid.iteritems():
                inputs = sinput.split(',')
                input = long(inputs[0])
                sub_input = None
                if len(inputs) == 2:
                    sub_input = long(inputs[1])
                t = xc.domain_set_cpuid(self.vm.getDomid(), input, sub_input,
                                        regs)
                transformed[sinput] = t
            self.cpuid = transformed

        if self.cpuid_check is not None:
            cpuid_check = self.cpuid_check
            transformed = {}
            for sinput, regs_check in cpuid_check.iteritems():
                inputs = sinput.split(',')
                input = long(inputs[0])
                sub_input = None
                if len(inputs) == 2:
                    sub_input = long(inputs[1])
                t = xc.domain_check_cpuid(input, sub_input, regs_check)
                transformed[sinput] = t
            self.cpuid_check = transformed