From: Olaf Hering Subject: [PATCH 10 of 15] xenpaging: compare both token and path when checking for @releaseDomain event Date: Fri, 21 Oct 2011 11:31:44 +0200 Message-ID: <0b7d7a2bd6673f358faf.1319189504@probook.site> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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 List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Olaf Hering # Date 1319189021 -7200 # Node ID 0b7d7a2bd6673f358faf0183b79b29e6a2f036a5 # Parent 6eb58c8bee87080c5e683a7b118aed7b87d675db xenpaging: compare both token and path when checking for @releaseDomain event Subsequent patches will use xenstored to store the numbers of pages xenpaging is suppose to page-out. A domain_id value could be misinterpreted as number of pages. Compare both path and token to recognize the @releaseDomain event. Also add debug output to show received watch event. Signed-off-by: Olaf Hering diff -r 6eb58c8bee87 -r 0b7d7a2bd667 tools/xenpaging/xenpaging.c --- a/tools/xenpaging/xenpaging.c +++ b/tools/xenpaging/xenpaging.c @@ -101,7 +101,8 @@ static int xenpaging_wait_for_event_or_t vec = xs_read_watch(paging->xs_handle, &num); if ( vec ) { - if ( strcmp(vec[XS_WATCH_TOKEN], watch_token) == 0 ) + DPRINTF("path '%s' token '%s'\n", vec[XS_WATCH_PATH], vec[XS_WATCH_TOKEN]); + if ( strcmp(vec[XS_WATCH_PATH], "@releaseDomain") == 0 && strcmp(vec[XS_WATCH_TOKEN], watch_token) == 0 ) { /* If our guest disappeared, set interrupt flag and fall through */ if ( xs_is_domain_introduced(paging->xs_handle, paging->mem_event.domain_id) == false )