Esempio n. 1
0
 def get_VCPUs_CPU(self):
     domid = self.xend_domain_instance.getDomid()
     if domid is not None:
         vcpus_cpu = {}
         vcpus_max = self.xend_domain_instance.info['VCPUs_max']
         for i in range(0, vcpus_max):
             info = xc.vcpu_getinfo(domid, i)
             vcpus_cpu[i] = info['cpu']
         return vcpus_cpu
     else:
         return {}
 def get_VCPUs_CPU(self):
     domid = self.xend_domain_instance.getDomid()
     if domid is not None:
         vcpus_cpu = {}
         vcpus_max = self.xend_domain_instance.info['VCPUs_max']
         for i in range(0, vcpus_max):
             info = xc.vcpu_getinfo(domid, i)
             vcpus_cpu[i] = info['cpu']
         return vcpus_cpu
     else:
         return {}
Esempio n. 3
0
    def get_VCPUs_params(self):
        domid = self.xend_domain_instance.getDomid()
        if domid is not None:
            params_live = {}
            vcpus_max = self.xend_domain_instance.info["VCPUs_max"]
            for i in range(0, vcpus_max):
                info = xc.vcpu_getinfo(domid, i)
                params_live["cpumap%i" % i] = ",".join(map(str, info["cpumap"]))

            params_live.update(xc.sched_credit_domain_get(domid))

            return params_live
        else:
            return {}
    def get_VCPUs_params(self):
        domid = self.xend_domain_instance.getDomid()
        if domid is not None:
            params_live = {}
            vcpus_max = self.xend_domain_instance.info['VCPUs_max']
            for i in range(0, vcpus_max):
                info = xc.vcpu_getinfo(domid, i)
                params_live['cpumap%i' % i] = \
                    ",".join(map(str, info['cpumap']))

            params_live.update(xc.sched_credit_domain_get(domid))

            return params_live
        else:
            return {}
Esempio n. 5
0
    def get_CPU_Affinity(self):
        domid = self.xend_domain_instance.getDomid()
        if domid is not None:
            params_live = {}
            vcpus_max = self.xend_domain_instance.info['VCPUs_max']
            for i in range(0, vcpus_max):
                info = xc.vcpu_getinfo(domid, i)
                params_live['cpumap%i' % i] = \
                    ",".join(map(str, info['cpumap']))

                # FIXME: credit2??
#            params_live.update(xc.sched_credit_domain_get(domid))
            
            return params_live
        else:
            return {}        
Esempio n. 6
0
 def get_VCPUs_flags(self):
     domid = self.xend_domain_instance.getDomid()
     if domid is not None:
         vcpus_flags = {}
         vcpus_max = self.xend_domain_instance.info['VCPUs_max']
         for i in range(0, vcpus_max):
             info = xc.vcpu_getinfo(domid, i)
             flags = []
             def set_flag(flag):
                 if info[flag] == 1:
                     flags.append(flag)
             set_flag('blocked')
             set_flag('online')
             set_flag('running')
             vcpus_flags[i] = flags
         return vcpus_flags
     else:
         return {}
    def get_VCPUs_flags(self):
        domid = self.xend_domain_instance.getDomid()
        if domid is not None:
            vcpus_flags = {}
            vcpus_max = self.xend_domain_instance.info['VCPUs_max']
            for i in range(0, vcpus_max):
                info = xc.vcpu_getinfo(domid, i)
                flags = []

                def set_flag(flag):
                    if info[flag] == 1:
                        flags.append(flag)

                set_flag('blocked')
                set_flag('online')
                set_flag('running')
                vcpus_flags[i] = flags
            return vcpus_flags
        else:
            return {}