From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yosuke Iwamatsu Subject: [PATCH 3/4] Log-dirty shared memory between stubdom-dm and xc_save (ioemu-remote part) Date: Tue, 16 Dec 2008 18:23:39 +0900 Message-ID: <4947739B.4090600@ab.jp.nec.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030901040900060600030704" 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@lists.xensource.com Cc: samuel.thibault@ens-lyon.org, Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------030901040900060600030704 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Process logdirty events when working as a stubdom-dm. Signed-off-by: Yosuke Iwamatsu Thanks, ----------------------- Yosuke Iwamatsu NEC Corporation --------------030901040900060600030704 Content-Type: all/allfiles; name="logdirty_ioemu.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="logdirty_ioemu.patch" Create log-dirty shared memory between stubdom-dm and xc_save. Process logdirty events when working as a stubdom-dm. Signed-off-by: Yosuke Iwamatsu diff --git a/xenstore.c b/xenstore.c index d064df1..3a3a0bd 100644 --- a/xenstore.c +++ b/xenstore.c @@ -596,10 +596,6 @@ extern int vga_ram_size, bios_size; void xenstore_process_logdirty_event(void) { -#ifdef CONFIG_STUBDOM - /* XXX we just can't use shm. */ - return; -#else char *act; static char *active_path = NULL; static char *next_active_path = NULL; @@ -638,6 +634,25 @@ void xenstore_process_logdirty_event(void) / HOST_LONG_BITS); /* longs */ logdirty_bitmap_size *= sizeof (unsigned long); /* bytes */ +#ifdef CONFIG_STUBDOM + /* Initialize logdirty bitmap */ + if (pasprintf(&path, + "/local/domain/0/device-model/%u/logdirty", + domid) == -1) { + fprintf(logfile, "Log-dirty: out of memory\n"); + exit(1); + } + + seg = init_logdirty_bitmap(path, logdirty_bitmap_size, 0); + if (seg == NULL) { + fprintf(logfile, "Log-dirty: failed to allocate bitmap\n"); + exit(1); + } + free(path); + + /* Write the size of bitmap into the first 32 bits */ + *(uint32_t *)seg = logdirty_bitmap_size; +#else /* Map the shared-memory segment */ fprintf(logfile, "%s: key=%16.16llx size=%lu\n", __FUNCTION__, (unsigned long long)key, logdirty_bitmap_size); @@ -666,6 +681,7 @@ void xenstore_process_logdirty_event(void) seg = NULL; return; } +#endif /* Remember the paths for the next-active and active entries */ if (pasprintf(&active_path, @@ -702,7 +718,6 @@ void xenstore_process_logdirty_event(void) /* Ack that we've switched */ xs_write(xsh, XBT_NULL, active_path, act, len); free(act); -#endif } --------------030901040900060600030704 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 --------------030901040900060600030704--