ia64/xen-unstable

changeset 4975:720cc7f4ebea

bitkeeper revision 1.1445 (428b4138WU0m20nAmwQHUjtcDWujKA)

Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
into firebug.cl.cam.ac.uk:/local/scratch/cl349/xen-unstable.bk
author cl349@firebug.cl.cam.ac.uk
date Wed May 18 13:20:56 2005 +0000 (2005-05-18)
parents 3a119b52ea72 eb1f6f21ee6b
children b7ff11fc3c57 97d31548a2b1
files tools/python/xen/xend/XendDomain.py xen/common/domain.c
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Wed May 18 13:16:32 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Wed May 18 13:20:56 2005 +0000
     1.3 @@ -109,7 +109,7 @@ class XendDomain:
     1.4          """Event handler for virq.
     1.5          """
     1.6          print 'onVirq>', val
     1.7 -        self.refresh_schedule(delay=0)
     1.8 +        self.refresh()
     1.9  
    1.10      def schedule_later(self, _delay, _name, _fn, *args):
    1.11          """Schedule a function to be called later (if not already scheduled).
    1.12 @@ -128,18 +128,6 @@ class XendDomain:
    1.13          """
    1.14          self.scheduler.cancel(name)
    1.15  
    1.16 -    def refresh_schedule(self, delay=1):
    1.17 -        """Schedule refresh to be called later.
    1.18 -        
    1.19 -        @param delay: delay in seconds
    1.20 -        """
    1.21 -        self.schedule_later(delay, 'refresh', self.refresh)
    1.22 -
    1.23 -    def refresh_cancel(self):
    1.24 -        """Cancel any scheduled refresh.
    1.25 -        """
    1.26 -        self.schedule_cancel('refresh')
    1.27 -
    1.28      def domain_restarts_schedule(self, delay=1):
    1.29          """Schedule domain_restarts to be called later.
    1.30          
    1.31 @@ -320,8 +308,6 @@ class XendDomain:
    1.32      def refresh(self):
    1.33          """Refresh domain list from Xen.
    1.34          """
    1.35 -        self.refresh_cancel()
    1.36 -        self.refresh_schedule(delay=10)
    1.37          self.reap()
    1.38          doms = self.xen_domains()
    1.39          # Add entries for any domains we don't know about.
    1.40 @@ -373,7 +359,6 @@ class XendDomain:
    1.41  
    1.42          @return: domain names
    1.43          """
    1.44 -        self.refresh()
    1.45          return self.domain_by_name.keys()
    1.46  
    1.47      def domain_ls_ids(self):
    1.48 @@ -506,16 +491,12 @@ class XendDomain:
    1.49          @param reason: shutdown type: poweroff, reboot, suspend, halt
    1.50          """
    1.51          dominfo = self.domain_lookup(id)
    1.52 -        if reason == 'halt':
    1.53 -            self.domain_restart_cancel(dominfo.id)
    1.54 -        else:
    1.55 -            self.domain_restart_schedule(dominfo.id, reason, force=True)
    1.56 +        self.domain_restart_schedule(dominfo.id, reason, force=True)
    1.57          eserver.inject('xend.domain.shutdown', [dominfo.name, dominfo.id, reason])
    1.58          if reason == 'halt':
    1.59              reason = 'poweroff'
    1.60          val = dominfo.shutdown(reason, key=key)
    1.61          self.add_shutdown(dominfo, reason, key)
    1.62 -        self.refresh_schedule(delay=10)
    1.63          return val
    1.64  
    1.65      def add_shutdown(self, dominfo, reason, key):
    1.66 @@ -566,12 +547,12 @@ class XendDomain:
    1.67          dominfo = self.domain_lookup(id)
    1.68          if not dominfo:
    1.69              return
    1.70 -        if dominfo.id in self.restarts_by_id:
    1.71 -            return
    1.72          restart = (force and reason == 'reboot') or dominfo.restart_needed(reason)
    1.73          if restart:
    1.74              dominfo.restarting()
    1.75              self.domain_restart_add(dominfo)
    1.76 +        else:
    1.77 +            self.domain_restart_cancel(dominfo.id)
    1.78  
    1.79      def domain_restart_add(self, dominfo):
    1.80          self.restarts_by_name[dominfo.name] = dominfo
    1.81 @@ -615,7 +596,7 @@ class XendDomain:
    1.82              self.domain_restart(dominfo)
    1.83          if self.domain_restarts_exist():
    1.84              # Run again later if any restarts remain.
    1.85 -            self.refresh_schedule(delay=10)
    1.86 +            self.domain_restarts_schedule(delay=10)
    1.87  
    1.88      def domain_restarts_exist(self):
    1.89          return len(self.restarts_by_id)
    1.90 @@ -645,12 +626,9 @@ class XendDomain:
    1.91  
    1.92          @param id: domain id
    1.93          """
    1.94 -        if reason == 'halt':
    1.95 -            self.domain_restart_cancel(id)
    1.96 -        elif reason == 'reboot':
    1.97 -            self.domain_restart_schedule(id, reason, force=True)
    1.98 +        self.domain_restart_schedule(id, reason, force=True)
    1.99          val = self.final_domain_destroy(id)
   1.100 -        self.refresh_schedule()
   1.101 +        self.refresh()
   1.102          return val
   1.103  
   1.104      def domain_migrate(self, id, dst, live=False, resource=0):
   1.105 @@ -735,7 +713,6 @@ class XendDomain:
   1.106          dominfo = self.domain_lookup(id)
   1.107          val = dominfo.device_create(devconfig)
   1.108          self.update_domain(dominfo.id)
   1.109 -        self.refresh_schedule()
   1.110          return val
   1.111  
   1.112      def domain_device_configure(self, id, devconfig, idx):
   1.113 @@ -749,7 +726,6 @@ class XendDomain:
   1.114          dominfo = self.domain_lookup(id)
   1.115          val = dominfo.device_configure(devconfig, idx)
   1.116          self.update_domain(dominfo.id)
   1.117 -        self.refresh_schedule()
   1.118          return val
   1.119      
   1.120      def domain_device_refresh(self, id, type, idx):
   1.121 @@ -762,7 +738,6 @@ class XendDomain:
   1.122          dominfo = self.domain_lookup(id)
   1.123          val = dominfo.device_refresh(type, idx)
   1.124          self.update_domain(dominfo.id)
   1.125 -        self.refresh_schedule()
   1.126          return val
   1.127  
   1.128      def domain_device_destroy(self, id, type, idx):
   1.129 @@ -775,7 +750,6 @@ class XendDomain:
   1.130          dominfo = self.domain_lookup(id)
   1.131          val = dominfo.device_destroy(type, idx)
   1.132          self.update_domain(dominfo.id)
   1.133 -        self.refresh_schedule()
   1.134          return val
   1.135  
   1.136      def domain_devtype_ls(self, id, type):
     2.1 --- a/xen/common/domain.c	Wed May 18 13:16:32 2005 +0000
     2.2 +++ b/xen/common/domain.c	Wed May 18 13:20:56 2005 +0000
     2.3 @@ -212,6 +212,8 @@ void domain_destruct(struct domain *d)
     2.4      free_xenheap_page((unsigned long)d->shared_info);
     2.5  
     2.6      free_domain_struct(d);
     2.7 +
     2.8 +    send_guest_virq(dom0->exec_domain[0], VIRQ_DOM_EXC);
     2.9  }
    2.10  
    2.11