WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] qemu-dm: Nicely terminate the device mode

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] qemu-dm: Nicely terminate the device model script, to let it properly
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 18 Jan 2008 08:50:12 -0800
Delivery-date: Fri, 18 Jan 2008 08:50:12 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1200663305 0
# Node ID 2ac0fd9fd4b462934e01c02b2f1510856e6461cd
# Parent  a1a3fe600ef3c6855809db62d6b3048226922dac
qemu-dm: Nicely terminate the device model script, to let it properly
clean resources.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
---
 tools/ioemu/target-i386-dm/helper2.c |   10 ++++++++--
 tools/python/xen/xend/image.py       |    2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff -r a1a3fe600ef3 -r 2ac0fd9fd4b4 tools/ioemu/target-i386-dm/helper2.c
--- a/tools/ioemu/target-i386-dm/helper2.c      Fri Jan 18 13:33:37 2008 +0000
+++ b/tools/ioemu/target-i386-dm/helper2.c      Fri Jan 18 13:35:05 2008 +0000
@@ -637,6 +637,7 @@ int main_loop(void)
     int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle);
     char qemu_file[PATH_MAX];
     fd_set fds;
+    int ret = 0;
 
     buffered_io_timer = qemu_new_timer(rt_clock, handle_buffered_io,
                                       cpu_single_env);
@@ -647,9 +648,14 @@ int main_loop(void)
 
     xenstore_record_dm_state("running");
     while (1) {
-        while (!(vm_running && suspend_requested))
+        while (!((vm_running && suspend_requested) || shutdown_requested))
             /* Wait up to 10 msec. */
             main_loop_wait(10);
+
+        if (shutdown_requested) {
+            ret = EXCP_INTERRUPT;
+            break;
+        }
 
         fprintf(logfile, "device model saving state\n");
 
@@ -676,7 +682,7 @@ int main_loop(void)
         xenstore_record_dm_state("running");
     }
 
-    return 0;
+    return ret;
 }
 
 void destroy_hvm_domain(void)
diff -r a1a3fe600ef3 -r 2ac0fd9fd4b4 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Fri Jan 18 13:33:37 2008 +0000
+++ b/tools/python/xen/xend/image.py    Fri Jan 18 13:35:05 2008 +0000
@@ -321,7 +321,7 @@ class ImageHandler:
             return
         if self.pid:
             try:
-                os.kill(self.pid, signal.SIGKILL)
+                os.kill(self.pid, signal.SIGTERM)
             except OSError, exn:
                 log.exception(exn)
             try:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] qemu-dm: Nicely terminate the device model script, to let it properly, Xen patchbot-unstable <=