[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] domain.c:



ChangeSet 1.1440.1.1, 2005/05/18 14:20:48+01:00, cl349@xxxxxxxxxxxxxxxxxxxx

        domain.c:
          Send VIRQ_DOM_EXC when domain_destruct removes a domain from
          Xen's list of domains.
        XendDomain.py:
          Now that virq's work, remove periodic domain refresh calls to reap 
expired
          domains.
        Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>



 tools/python/xen/xend/XendDomain.py |   40 ++++++------------------------------
 xen/common/domain.c                 |    2 +
 2 files changed, 9 insertions(+), 33 deletions(-)


diff -Nru a/tools/python/xen/xend/XendDomain.py 
b/tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       2005-05-18 10:07:01 -04:00
+++ b/tools/python/xen/xend/XendDomain.py       2005-05-18 10:07:01 -04:00
@@ -109,7 +109,7 @@
         """Event handler for virq.
         """
         print 'onVirq>', val
-        self.refresh_schedule(delay=0)
+        self.refresh()
 
     def schedule_later(self, _delay, _name, _fn, *args):
         """Schedule a function to be called later (if not already scheduled).
@@ -128,18 +128,6 @@
         """
         self.scheduler.cancel(name)
 
-    def refresh_schedule(self, delay=1):
-        """Schedule refresh to be called later.
-        
-        @param delay: delay in seconds
-        """
-        self.schedule_later(delay, 'refresh', self.refresh)
-
-    def refresh_cancel(self):
-        """Cancel any scheduled refresh.
-        """
-        self.schedule_cancel('refresh')
-
     def domain_restarts_schedule(self, delay=1):
         """Schedule domain_restarts to be called later.
         
@@ -320,8 +308,6 @@
     def refresh(self):
         """Refresh domain list from Xen.
         """
-        self.refresh_cancel()
-        self.refresh_schedule(delay=10)
         self.reap()
         doms = self.xen_domains()
         # Add entries for any domains we don't know about.
@@ -373,7 +359,6 @@
 
         @return: domain names
         """
-        self.refresh()
         return self.domain_by_name.keys()
 
     def domain_ls_ids(self):
@@ -506,16 +491,12 @@
         @param reason: shutdown type: poweroff, reboot, suspend, halt
         """
         dominfo = self.domain_lookup(id)
-        if reason == 'halt':
-            self.domain_restart_cancel(dominfo.id)
-        else:
-            self.domain_restart_schedule(dominfo.id, reason, force=True)
+        self.domain_restart_schedule(dominfo.id, reason, force=True)
         eserver.inject('xend.domain.shutdown', [dominfo.name, dominfo.id, 
reason])
         if reason == 'halt':
             reason = 'poweroff'
         val = dominfo.shutdown(reason, key=key)
         self.add_shutdown(dominfo, reason, key)
-        self.refresh_schedule(delay=10)
         return val
 
     def add_shutdown(self, dominfo, reason, key):
@@ -566,12 +547,12 @@
         dominfo = self.domain_lookup(id)
         if not dominfo:
             return
-        if dominfo.id in self.restarts_by_id:
-            return
         restart = (force and reason == 'reboot') or 
dominfo.restart_needed(reason)
         if restart:
             dominfo.restarting()
             self.domain_restart_add(dominfo)
+        else:
+            self.domain_restart_cancel(dominfo.id)
 
     def domain_restart_add(self, dominfo):
         self.restarts_by_name[dominfo.name] = dominfo
@@ -615,7 +596,7 @@
             self.domain_restart(dominfo)
         if self.domain_restarts_exist():
             # Run again later if any restarts remain.
-            self.refresh_schedule(delay=10)
+            self.domain_restarts_schedule(delay=10)
 
     def domain_restarts_exist(self):
         return len(self.restarts_by_id)
@@ -645,12 +626,9 @@
 
         @param id: domain id
         """
-        if reason == 'halt':
-            self.domain_restart_cancel(id)
-        elif reason == 'reboot':
-            self.domain_restart_schedule(id, reason, force=True)
+        self.domain_restart_schedule(id, reason, force=True)
         val = self.final_domain_destroy(id)
-        self.refresh_schedule()
+        self.refresh()
         return val
 
     def domain_migrate(self, id, dst, live=False, resource=0):
@@ -735,7 +713,6 @@
         dominfo = self.domain_lookup(id)
         val = dominfo.device_create(devconfig)
         self.update_domain(dominfo.id)
-        self.refresh_schedule()
         return val
 
     def domain_device_configure(self, id, devconfig, idx):
@@ -749,7 +726,6 @@
         dominfo = self.domain_lookup(id)
         val = dominfo.device_configure(devconfig, idx)
         self.update_domain(dominfo.id)
-        self.refresh_schedule()
         return val
     
     def domain_device_refresh(self, id, type, idx):
@@ -762,7 +738,6 @@
         dominfo = self.domain_lookup(id)
         val = dominfo.device_refresh(type, idx)
         self.update_domain(dominfo.id)
-        self.refresh_schedule()
         return val
 
     def domain_device_destroy(self, id, type, idx):
@@ -775,7 +750,6 @@
         dominfo = self.domain_lookup(id)
         val = dominfo.device_destroy(type, idx)
         self.update_domain(dominfo.id)
-        self.refresh_schedule()
         return val
 
     def domain_devtype_ls(self, id, type):
diff -Nru a/xen/common/domain.c b/xen/common/domain.c
--- a/xen/common/domain.c       2005-05-18 10:07:01 -04:00
+++ b/xen/common/domain.c       2005-05-18 10:07:01 -04:00
@@ -212,6 +212,8 @@
     free_xenheap_page((unsigned long)d->shared_info);
 
     free_domain_struct(d);
+
+    send_guest_virq(dom0->exec_domain[0], VIRQ_DOM_EXC);
 }
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.