|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 03 of 22 v3] xenpaging: add xs_handle to struct xenpa
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 <olaf@xxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
diff -r 2faf6e491708 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c Tue Jun 21 17:28:56 2011 +0200
+++ b/tools/xenpaging/xenpaging.c Tue Jun 21 17:31:33 2011 +0200
@@ -28,6 +28,7 @@
#include <signal.h>
#include <unistd.h>
#include <xc_private.h>
+#include <xs.h>
#include <xen/mem_event.h>
@@ -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_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_close(paging->xs_handle);
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_close(paging->xs_handle);
+
/* Close connection to Xen */
rc = xc_interface_close(xch);
if ( rc != 0 )
diff -r 2faf6e491708 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h Tue Jun 21 17:28:56 2011 +0200
+++ b/tools/xenpaging/xenpaging.h Tue Jun 21 17:31:33 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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
[Xen-devel] [PATCH 08 of 22] xenpaging: drop xc.c, move xc_wait_for_event_or_timeout, Olaf Hering
[Xen-devel] [PATCH 04 of 22] xenpaging: drop xc.c, remove ASSERT, Olaf Hering
[Xen-devel] [PATCH 11 of 22] xenpaging: do not bounce p2mt to xenpaging, Olaf Hering
[Xen-devel] [PATCH 06 of 22] xenpaging: drop xc.c, remove xc_wait_for_event, Olaf Hering
[Xen-devel] [PATCH 12 of 22] xenpaging: remove srand call, Olaf Hering
[Xen-devel] [PATCH 10 of 22] xenpaging: correct dropping of pages to avoid full ring buffer, Olaf Hering
[Xen-devel] [PATCH 02 of 22] tools: merge several bitop functions into xc_bitops.h, Olaf Hering
|
|
|
|
|