All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Guthro <bguthro@virtualiron.com>
To: xen-devel <xen-devel@lists.xensource.com>,
	Gary Grebus <ggrebus@virtualiron.com>
Subject: [PATCH][QEMU] Logdirty debug cleanup
Date: Wed, 24 Oct 2007 16:59:35 -0400	[thread overview]
Message-ID: <471FB237.5000401@virtualiron.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

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@virtualron.com>
Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>

[-- Attachment #2: qemu-logdirty-debug.patch --]
[-- Type: text/x-patch, Size: 1340 bytes --]

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);
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

                 reply	other threads:[~2007-10-24 20:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=471FB237.5000401@virtualiron.com \
    --to=bguthro@virtualiron.com \
    --cc=ggrebus@virtualiron.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.