From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Guthro Subject: [PATCH][QEMU] Logdirty debug cleanup Date: Wed, 24 Oct 2007 16:59:35 -0400 Message-ID: <471FB237.5000401@virtualiron.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050001070307050503040104" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel , Gary Grebus List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------050001070307050503040104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Restructure and add some debug messages around mapping the logdirty bitmap to make it clearer which operation is failing. Signed-off-by: Ben Guthro Signed-off-by: Gary Grebus --------------050001070307050503040104 Content-Type: text/x-patch; name="qemu-logdirty-debug.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-logdirty-debug.patch" 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); --------------050001070307050503040104 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------050001070307050503040104--