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

[Xen-ia64-devel] [PATCH] [IA64] Remus: ia64 counter part of 07f6d9047af4

To: xen-devel@xxxxxxxxxxxxxxxxxxx, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] [IA64] Remus: ia64 counter part of 07f6d9047af4
From: "KUWAMURA Shin'ya" <kuwa@xxxxxxxxxxxxxx>
Date: Fri, 20 Nov 2009 11:03:02 +0900 (JST)
Cc:
Delivery-date: Thu, 19 Nov 2009 18:03:52 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

The changeset 20405:07f6d9047af4 breaks ia64.
This patch adds callbacks to xc_domain_save() in
ia64/xc_ia64_linux_save.c.

Best regards,
-- 
  KUWAMURA Shin'ya
# HG changeset patch
# User KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
# Date 1258528176 -32400
# Node ID 7875c75dc92d1707843151da28bbd71f90ab7329
# Parent  bec27eb6f72cfb3fcecd8eb3060869fa301a62df
[IA64] Remus: ia64 counter part of 07f6d9047af4

This patch adds callbacks to xc_domain_save().

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>

diff -r bec27eb6f72c -r 7875c75dc92d tools/libxc/ia64/xc_ia64_linux_save.c
--- a/tools/libxc/ia64/xc_ia64_linux_save.c     Sat Nov 14 10:32:59 2009 +0000
+++ b/tools/libxc/ia64/xc_ia64_linux_save.c     Wed Nov 18 16:09:36 2009 +0900
@@ -53,10 +53,11 @@ static inline void set_bit(int nr, volat
 }
 
 static int
-suspend_and_state(int (*suspend)(void), int xc_handle, int io_fd,
+suspend_and_state(int (*suspend)(void*), void* data,
+                  int xc_handle, int io_fd,
                   int dom, xc_dominfo_t *info)
 {
-    if (!(*suspend)()) {
+    if ( !(*suspend)(data) ) {
         ERROR("Suspend request failed");
         return -1;
     }
@@ -381,7 +382,8 @@ out:
 
 int
 xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
-               uint32_t max_factor, uint32_t flags, int (*suspend)(void),
+               uint32_t max_factor, uint32_t flags,
+               struct save_callbacks* callbacks,
                int hvm, void (*switch_qemu_logdirty)(int, unsigned))
 {
     DECLARE_DOMCTL;
@@ -405,7 +407,7 @@ xc_domain_save(int xc_handle, int io_fd,
     unsigned int sent_last_iter;
 
     /* Number of pages sent (live only).  */
-    unsigned int total_sent;
+    unsigned int total_sent = 0;
 
     /* total number of pages used by the current guest */
     unsigned long p2m_size;
@@ -414,7 +416,7 @@ xc_domain_save(int xc_handle, int io_fd,
     unsigned int bitmap_size = 0;
 
     /* True if last iteration.  */
-    int last_iter;
+    int last_iter = 0;
 
     /* Bitmap of pages to be sent.  */
     unsigned long *to_send = NULL;
@@ -549,7 +551,8 @@ xc_domain_save(int xc_handle, int io_fd,
 
         last_iter = 1;
 
-        if (suspend_and_state(suspend, xc_handle, io_fd, dom, &info)) {
+        if (suspend_and_state(callbacks->suspend, callbacks->data, xc_handle,
+                              io_fd, dom, &info)) {
             ERROR("Domain appears not to have suspended");
             goto out;
         }
@@ -580,8 +583,8 @@ xc_domain_save(int xc_handle, int io_fd,
     }
 
     sent_last_iter = p2m_size;
-    total_sent = 0;
 
+ copypages:
     for (iter = 1; ; iter++) {
         unsigned int sent_this_iter, skip_this_iter;
         unsigned long N;
@@ -677,7 +680,8 @@ xc_domain_save(int xc_handle, int io_fd,
                 DPRINTF("Start last iteration\n");
                 last_iter = 1;
 
-                if (suspend_and_state(suspend, xc_handle, io_fd, dom, &info)) {
+                if (suspend_and_state(callbacks->suspend, callbacks->data,
+                                      xc_handle, io_fd, dom, &info)) {
                     ERROR("Domain appears not to have suspended");
                     goto out;
                 }
@@ -727,6 +731,39 @@ xc_domain_save(int xc_handle, int io_fd,
     rc = 0;
 
  out:
+   if ( !rc && callbacks->postcopy )
+       callbacks->postcopy(callbacks->data);
+
+   /* Flush last write and discard cache for file. */
+   discard_file_cache(io_fd, 1 /* flush */);
+
+   /* checkpoint_cb can spend arbitrarily long in between rounds */
+   if (!rc && callbacks->checkpoint &&
+       callbacks->checkpoint(callbacks->data) > 0)
+   {
+       /* reset stats timer */
+       //print_stats(xc_handle, dom, 0, &stats, 0);
+
+       rc = 1;
+       /* last_iter = 1; */
+       if ( suspend_and_state(callbacks->suspend, callbacks->data, xc_handle,
+                              io_fd, dom, &info) )
+       {
+           ERROR("Domain appears not to have suspended");
+           goto out;
+       }
+       DPRINTF("SUSPEND shinfo %08lx\n", info.shared_info_frame);
+       //print_stats(xc_handle, dom, 0, &stats, 1);
+
+       if ( xc_shadow_control(xc_handle, dom,
+                              XEN_DOMCTL_SHADOW_OP_CLEAN, to_send,
+                              p2m_size, NULL, 0, NULL) != p2m_size )
+       {
+           ERROR("Error flushing shadow PT");
+       }
+
+       goto copypages;
+   }
 
     if (live) {
         if (xc_shadow_control(xc_handle, dom,
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH] [IA64] Remus: ia64 counter part of 07f6d9047af4, KUWAMURA Shin'ya <=