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-devel

[Xen-devel] [PATCH 3 of 7] Make suspend return 1 when a domain is resume

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 3 of 7] Make suspend return 1 when a domain is resumed
From: Brendan Cully <brendan@xxxxxxxxx>
Date: Mon, 15 Jan 2007 12:05:13 -0700
Delivery-date: Mon, 15 Jan 2007 12:11:35 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1168891510@xxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Brendan Cully <brendan@xxxxxxxxx>
# Date 1168891374 28800
# Node ID 477813c50e5db59ae08d346288edf19eaf19dbcb
# Parent  204aa85417bd0c618cfe6dd69088a9a443191196
Make suspend return 1 when a domain is resumed.

Signed-off-by: Brendan Cully <brendan@xxxxxxxxx>

diff -r 204aa85417bd -r 477813c50e5d tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c       Mon Jan 15 12:01:27 2007 -0800
+++ b/tools/libxc/xc_linux_save.c       Mon Jan 15 12:02:54 2007 -0800
@@ -569,7 +569,18 @@ static xen_pfn_t *xc_map_m2p(int xc_hand
     return m2p;
 }
 
-
+static int xc_set_vcpucontext(int xc_handle, uint32_t dom,
+                              vcpu_guest_context_t *ctxt)
+{
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_setvcpucontext;
+    domctl.domain = (domid_t)dom;
+    domctl.u.vcpucontext.vcpu = 0;
+    set_xen_guest_handle(domctl.u.vcpucontext.ctxt, ctxt);
+
+    return xc_domctl(xc_handle, &domctl);
+}
 
 int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
                   uint32_t max_factor, uint32_t flags, int (*suspend)(int))
@@ -1188,6 +1199,12 @@ int xc_linux_save(int xc_handle, int io_
         goto out;
     }
 
+    /* set hypercall return code to indicate domain is resuming */
+    ctxt.user_regs.eax = 1;
+    rc = xc_set_vcpucontext(xc_handle, dom, &ctxt);
+    if (rc)
+        ERROR("Error setting hypercall return code");
+
     /* Success! */
     rc = 0;
 

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