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][QEMU] Logdirty debug cleanup

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Gary Grebus <ggrebus@xxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][QEMU] Logdirty debug cleanup
From: Ben Guthro <bguthro@xxxxxxxxxxxxxxx>
Date: Wed, 24 Oct 2007 16:59:35 -0400
Delivery-date: Wed, 24 Oct 2007 14:19:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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
User-agent: Thunderbird 2.0.0.5 (X11/20070719)
Restructure and add some debug messages around mapping the logdirty bitmap to
make it clearer which operation is failing.

Signed-off-by: Ben Guthro <bguthro@xxxxxxxxxxxxxx>
Signed-off-by: Gary Grebus <ggrebus@xxxxxxxxxxxxxxx>
diff -r 34e634f6743d tools/ioemu/xenstore.c
--- a/tools/ioemu/xenstore.c    Mon Aug 06 15:30:36 2007 -0400
+++ b/tools/ioemu/xenstore.c    Mon Aug 06 15:30:36 2007 -0400
@@ -296,14 +296,21 @@ void xenstore_process_logdirty_event(voi
         logdirty_bitmap_size *= sizeof (unsigned long); /* bytes */
 
         /* Map the shared-memory segment */
-        if ((shmid = shmget(key, 
-                            2 * logdirty_bitmap_size, 
-                            S_IRUSR|S_IWUSR)) == -1 
-            || (seg = shmat(shmid, NULL, 0)) == (void *)-1) {
-            fprintf(logfile, "Log-dirty: can't map segment %16.16llx (%s)\n",
+       fprintf(logfile, "%s: key=%16.16llx size=%d\n", __FUNCTION__,
+               (unsigned long long)key, logdirty_bitmap_size);
+        shmid = shmget(key, 2 * logdirty_bitmap_size, S_IRUSR|S_IWUSR);
+       if (shmid == -1) {
+            fprintf(logfile, "Log-dirty: shmget failed: segment %16.16llx 
(%s)\n",
                     (unsigned long long) key, strerror(errno));
-            exit(1);
-        }
+           exit(1);
+       }
+
+       seg = shmat(shmid, NULL, 0);
+       if (seg == (void *)-1) {
+            fprintf(logfile, "Log-dirty: shmat failed: segment %16.16llx 
(%s)\n",
+                    (unsigned long long) key, strerror(errno));
+           exit(1);
+       }
 
         fprintf(logfile, "Log-dirty: mapped segment at %p\n", seg);
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][QEMU] Logdirty debug cleanup, Ben Guthro <=