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

[Xen-changelog] [xen-unstable] xl: resume the domain on suspend failure


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Thu, 27 Sep 2012 22:33:12 +0000
  • Delivery-date: Thu, 27 Sep 2012 22:33:19 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Bastian Blank <waldi@xxxxxxxxxx>
# Date 1348567431 -3600
# Node ID 16ee1d300cfd15fcb99f743763521d71e7d8b221
# Parent  795c493fe561040805385ef792e6afd6db2cd7ea
xl: resume the domain on suspend failure

The MUST macro calls exit(3) on failure but we need to cleanup and
resume.

Signed-off-by: Bastian Blank <waldi@xxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 795c493fe561 -r 16ee1d300cfd tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Sep 25 11:03:51 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Tue Sep 25 11:03:51 2012 +0100
@@ -2992,15 +2992,18 @@ static int save_domain(uint32_t domid, c
 
     save_domain_core_writeconfig(fd, filename, config_data, config_len);
 
-    MUST(libxl_domain_suspend(ctx, domid, fd, 0, NULL));
+    int rc = libxl_domain_suspend(ctx, domid, fd, 0, NULL);
     close(fd);
 
-    if (checkpoint)
+    if (rc < 0)
+        fprintf(stderr, "Failed to save domain, resuming domain\n");
+
+    if (checkpoint || rc < 0)
         libxl_domain_resume(ctx, domid, 1, 0);
     else
         libxl_domain_destroy(ctx, domid, 0);
 
-    exit(0);
+    exit(rc < 0 ? 1 : 0);
 }
 
 static pid_t create_migration_child(const char *rune, int *send_fd,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.