ia64/xen-unstable

changeset 7838:009eb32c0ae4

Merged.
author emellor@leeni.uk.xensource.com
date Tue Nov 15 19:09:30 2005 +0100 (2005-11-15)
parents 210a5b625e30 5e111356ba17
children 10bafcc750fb
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Nov 15 19:08:11 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Nov 15 19:09:30 2005 +0100
     1.3 @@ -188,7 +188,7 @@ static int __do_suspend(void *ignore)
     1.4  	xenbus_resume();
     1.5  
     1.6  #ifdef CONFIG_SMP
     1.7 -	for_each_present_cpu(i)
     1.8 +	for_each_cpu(i)
     1.9  		vcpu_prepare(i);
    1.10  
    1.11   out_reenable_cpus:
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Tue Nov 15 19:08:11 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Tue Nov 15 19:09:30 2005 +0100
     2.3 @@ -277,6 +277,18 @@ void __devinit smp_prepare_boot_cpu(void
     2.4  
     2.5  #ifdef CONFIG_HOTPLUG_CPU
     2.6  
     2.7 +/*
     2.8 + * Initialize cpu_present_map late to skip SMP boot code in init/main.c.
     2.9 + * But do it early enough to catch critical for_each_present_cpu() loops
    2.10 + * in i386-specific code.
    2.11 + */
    2.12 +static int __init initialize_cpu_present_map(void)
    2.13 +{
    2.14 +	cpu_present_map = cpu_possible_map;
    2.15 +	return 0;
    2.16 +}
    2.17 +core_initcall(initialize_cpu_present_map);
    2.18 +
    2.19  static void vcpu_hotplug(unsigned int cpu)
    2.20  {
    2.21  	int err;
    2.22 @@ -293,7 +305,6 @@ static void vcpu_hotplug(unsigned int cp
    2.23  	}
    2.24  
    2.25  	if (strcmp(state, "online") == 0) {
    2.26 -		cpu_set(cpu, cpu_present_map);
    2.27  		(void)cpu_up(cpu);
    2.28  	} else if (strcmp(state, "offline") == 0) {
    2.29  		(void)cpu_down(cpu);
     3.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Nov 15 19:08:11 2005 +0100
     3.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Nov 15 19:09:30 2005 +0100
     3.3 @@ -437,10 +437,18 @@ class XendDomainInfo:
     3.4              defaultInfo('on_crash',     lambda: "restart")
     3.5              defaultInfo('cpu',          lambda: None)
     3.6              defaultInfo('cpu_weight',   lambda: 1.0)
     3.7 -            defaultInfo('vcpus',        lambda: int(1))
     3.8  
     3.9 -            self.info['vcpus'] = int(self.info['vcpus'])
    3.10 +            # some domains don't have a config file (e.g. dom0 )
    3.11 +            # to set number of vcpus so we derive available cpus
    3.12 +            # from max_vcpu_id which is present for running domains.
    3.13 +            if not self.infoIsSet('vcpus') and self.infoIsSet('max_vcpu_id'):
    3.14 +                avail = int(self.info['max_vcpu_id'])+1
    3.15 +            else:
    3.16 +                avail = int(1)
    3.17  
    3.18 +            defaultInfo('vcpus',        lambda: avail)
    3.19 +            defaultInfo('online_vcpus', lambda: self.info['vcpus'])
    3.20 +            defaultInfo('max_vcpu_id',  lambda: self.info['vcpus']-1)
    3.21              defaultInfo('vcpu_avail',   lambda: (1 << self.info['vcpus']) - 1)
    3.22  
    3.23              defaultInfo('memory',       lambda: 0)
    3.24 @@ -927,6 +935,7 @@ class XendDomainInfo:
    3.25          if self.infoIsSet('cpu_time'):
    3.26              sxpr.append(['cpu_time', self.info['cpu_time']/1e9])
    3.27          sxpr.append(['vcpus', self.info['vcpus']])
    3.28 +        sxpr.append(['online_vcpus', self.info['online_vcpus']])
    3.29              
    3.30          if self.infoIsSet('start_time'):
    3.31              up_time =  time.time() - self.info['start_time']
    3.32 @@ -943,16 +952,13 @@ class XendDomainInfo:
    3.33  
    3.34      def getVCPUInfo(self):
    3.35          try:
    3.36 -            def filter_cpumap(map, max):
    3.37 -                return filter(lambda x: x >= 0, map[0:max])
    3.38 -
    3.39              # We include the domain name and ID, to help xm.
    3.40              sxpr = ['domain',
    3.41                      ['domid',      self.domid],
    3.42                      ['name',       self.info['name']],
    3.43 -                    ['vcpu_count', self.info['vcpus']]]
    3.44 +                    ['vcpu_count', self.info['online_vcpus']]]
    3.45  
    3.46 -            for i in range(0, self.info['vcpus']):
    3.47 +            for i in range(0, self.info['max_vcpu_id']+1):
    3.48                  info = xc.vcpu_getinfo(self.domid, i)
    3.49  
    3.50                  sxpr.append(['vcpu',
    3.51 @@ -962,8 +968,7 @@ class XendDomainInfo:
    3.52                               ['running',  info['running']],
    3.53                               ['cpu_time', info['cpu_time'] / 1e9],
    3.54                               ['cpu',      info['cpu']],
    3.55 -                             ['cpumap',   filter_cpumap(info['cpumap'],
    3.56 -                                                        self.info['vcpus'])]])
    3.57 +                             ['cpumap',   info['cpumap']]])
    3.58  
    3.59              return sxpr
    3.60  
     4.1 --- a/tools/python/xen/xm/main.py	Tue Nov 15 19:08:11 2005 +0100
     4.2 +++ b/tools/python/xen/xm/main.py	Tue Nov 15 19:09:30 2005 +0100
     4.3 @@ -260,13 +260,13 @@ def parse_doms_info(info):
     4.4          return t(sxp.child_value(info, n, d))
     4.5      
     4.6      return {
     4.7 -        'dom'      : get_info('domid',    int,   -1),
     4.8 -        'name'     : get_info('name',     str,   '??'),
     4.9 -        'mem'      : get_info('memory',   int,   0),
    4.10 -        'vcpus'    : get_info('vcpus',    int,   0),
    4.11 -        'state'    : get_info('state',    str,   '??'),
    4.12 -        'cpu_time' : get_info('cpu_time', float, 0),
    4.13 -        'ssidref'  : get_info('ssidref',  int,   0),
    4.14 +        'dom'      : get_info('domid',        int,   -1),
    4.15 +        'name'     : get_info('name',         str,   '??'),
    4.16 +        'mem'      : get_info('memory',       int,   0),
    4.17 +        'vcpus'    : get_info('online_vcpus', int,   0),
    4.18 +        'state'    : get_info('state',        str,   '??'),
    4.19 +        'cpu_time' : get_info('cpu_time',     float, 0),
    4.20 +        'ssidref'  : get_info('ssidref',      int,   0),
    4.21          }
    4.22  
    4.23