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] [RFC][PATCH 13/13] Kemari: use shared region with to flip lo

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [RFC][PATCH 13/13] Kemari: use shared region with to flip logdirty_bitmap
From: Yoshiaki Tamura <tamura.yoshiaki@xxxxxxxxxxxxx>
Date: Thu, 12 Mar 2009 10:23:12 +0900
Cc: "柳澤佳里(yanagisawa yoshisato)" <yanagisawa.yoshisato@xxxxxxxxxxxxx>, Ian Pratt <ian.pratt@xxxxxxxxxx>, ian.jackson@xxxxxxxxxxxxx, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Wed, 11 Mar 2009 18:45:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <49B86208.2020205@xxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <49B86208.2020205@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)
This is an updated version of the following patch.  No major changes.

http://lists.xensource.com/archives/html/xen-devel/2009-03/msg00382.html

Signed-off-by: Yoshisato Yanagisawa <yanagisawa.yoshisato@xxxxxxxxxxxxx>
Signed-off-by: Yoshi Tamura <tamura.yoshiaki@xxxxxxxxxxxxx>
---
 xenstore.c |   30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/xenstore.c b/xenstore.c
index 928e950..4333c79 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -639,6 +639,8 @@ void xenstore_process_logdirty_event(void)
     static char *active_path = NULL;
     static char *next_active_path = NULL;
     static char *seg = NULL;
+    static char *kemari_qemu_info = NULL;
+    static char *qemu_file = NULL;
     unsigned int len;
     int i;

@@ -705,6 +707,8 @@ void xenstore_process_logdirty_event(void)
             seg = NULL;
             return;
         }
+        kemari_qemu_info = seg + logdirty_bitmap_size * 2;
+        asprintf(&qemu_file, "/dev/shm/qemu-save.%d", domid); /* use tmpfs */
 #endif

         /* Remember the paths for the next-active and active entries */
@@ -722,8 +726,32 @@ void xenstore_process_logdirty_event(void)
         }
     }

+#ifndef CONFIG_STUBDOM
+    if (kemari_enabled) {
+        while (kemari_qemu_info[1])
+            xen_rmb();
+
+        /* Switch buffers */
+        i = kemari_qemu_info[0];
+        if (i != 0 && i != 1) {
+            fprintf(logfile, "Log-dirty: bad next-active entry: %s\n", act);
+            exit(1);
+        }
+        logdirty_bitmap = (unsigned long *)(seg + i * logdirty_bitmap_size);
+        kemari_qemu_info[1] = 1;
+        xen_wmb();
+
+        /* Save QEMU status */
+        while (kemari_qemu_info[2])
+            xen_rmb();
+        do_savevm(qemu_file);
+        kemari_qemu_info[2] = 1;
+        xen_wmb();
+        return;
+    }
+#endif /* !CONFIG_STUBDOM */
     fprintf(logfile, "Triggered log-dirty buffer switch\n");
-
+
     /* Read the required active buffer from the store */
     act = xs_read(xsh, XBT_NULL, next_active_path, &len);
     if (!act) {


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