From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 03 of 22] xenpaging: add xs_handle to struct xenpaging Date: Tue, 14 Jun 2011 12:05:12 +0100 Message-ID: <1308049512.17937.61.camel@zakaz.uk.xensource.com> References: <2d2fe3e2bd73d0c257bb.1307697172@probook.site> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <2d2fe3e2bd73d0c257bb.1307697172@probook.site> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Olaf Hering Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Fri, 2011-06-10 at 10:12 +0100, Olaf Hering wrote: > # HG changeset patch > # User Olaf Hering > # Date 1307695625 -7200 > # Node ID 2d2fe3e2bd73d0c257bb852ecb00052d0dcef301 > # Parent 9476d85932e5eb8f1e7ce0a6814b6c0634341e61 > xenpaging: add xs_handle to struct xenpaging > > A xs_handle is currently used in the xc_mem_paging_flush_ioemu_cache() > function and will be used by a subsequent patch. > Add it to struct xenpaging. > > Signed-off-by: Olaf Hering > > diff -r 9476d85932e5 -r 2d2fe3e2bd73 tools/xenpaging/xenpaging.c > --- a/tools/xenpaging/xenpaging.c Fri Jun 10 10:47:03 2011 +0200 > +++ b/tools/xenpaging/xenpaging.c Fri Jun 10 10:47:05 2011 +0200 > @@ -28,6 +28,7 @@ > #include > #include > #include > +#include > > #include > > @@ -92,6 +93,14 @@ static xenpaging_t *xenpaging_init(domid > paging = malloc(sizeof(xenpaging_t)); > memset(paging, 0, sizeof(xenpaging_t)); > > + /* Open connection to xenstore */ > + paging->xs_handle = xs_daemon_open(); xs_daemon_open is deprecated, please use xs_open(0). > + if ( paging->xs_handle == NULL ) > + { > + ERROR("Error initialising xenstore connection"); > + goto err; > + } > + > p = getenv("XENPAGING_POLICY_MRU_SIZE"); > if ( p && *p ) > { > @@ -221,6 +230,8 @@ static xenpaging_t *xenpaging_init(domid > err: > if ( paging ) > { > + if ( paging->xs_handle ) > + xs_daemon_close(paging->xs_handle); Similarly please use xs_close(). > xc_interface_close(xch); > if ( paging->mem_event.shared_page ) > { > @@ -277,6 +288,9 @@ static int xenpaging_teardown(xenpaging_ > } > paging->mem_event.xce_handle = NULL; > > + /* Close connection to xenstore */ > + xs_daemon_close(paging->xs_handle); > + > /* Close connection to Xen */ > rc = xc_interface_close(xch); > if ( rc != 0 ) > diff -r 9476d85932e5 -r 2d2fe3e2bd73 tools/xenpaging/xenpaging.h > --- a/tools/xenpaging/xenpaging.h Fri Jun 10 10:47:03 2011 +0200 > +++ b/tools/xenpaging/xenpaging.h Fri Jun 10 10:47:05 2011 +0200 > @@ -36,6 +36,7 @@ > > typedef struct xenpaging { > xc_interface *xc_handle; > + struct xs_handle *xs_handle; > > xc_platform_info_t *platform_info; > xc_domaininfo_t *domain_info; > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel