SHA256
1
0
forked from pool/xen
xen/xenpaging.xc_interface_open-comment.patch
Olaf Hering ee2be8156e - fate#310510 - fix xenpaging
This change reverses the task of xenpaging. Before this change a
  fixed number of pages was paged out. With this change the guest
  will not have access to more than the given number of pages at
  the same time.
  The xenpaging= config option is replaced by actmem=
  A new xm mem-swap-target is added.
  The xenpaging binary is moved to /usr/lib/xen/bin/
  xenpaging.HVMCOPY_gfn_paged_out.patch
  xenpaging.XEN_PAGING_DIR.patch
  xenpaging.add_evict_pages.patch
  xenpaging.bitmap_clear.patch
  xenpaging.cmdline-interface.patch
  xenpaging.encapsulate_domain_info.patch
  xenpaging.file_op-return-code.patch
  xenpaging.guest-memusage.patch
  xenpaging.install-to-libexec.patch
  xenpaging.low_target_policy_nomru.patch
  xenpaging.main-loop-exit-handling.patch
  xenpaging.misleading-comment.patch
  xenpaging.page_in-munmap-size.patch
  xenpaging.print-gfn.patch
  xenpaging.record-numer-paged-out-pages.patch
  xenpaging.reset-uncomsumed.patch
  xenpaging.stale-comments.patch
  xenpaging.target-tot_pages.patch
  xenpaging.use-PERROR.patch
  xenpaging.watch-target-tot_pages.patch
  xenpaging.watch_event-DPRINTF.patch
  xenpaging.xc_interface_open-comment.patch

- xen.spec: update filelist
  package /usr/lib*/xen with wildcard to pickup new files
  remove duplicate /usr/sbin/xen-list from filelist

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=157
2011-11-03 22:59:30 +00:00

74 lines
2.1 KiB
Diff

# HG changeset patch
# Parent c6014fd38d1f150dd433985f8388b4858ba5aaca
xenpaging: update xenpaging_init
Move comment about xc_handle to the right place.
Allocate paging early and use calloc.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
tools/xenpaging/xenpaging.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -169,18 +169,21 @@ static xenpaging_t *xenpaging_init(domid
char *p;
int rc;
+ /* Allocate memory */
+ paging = calloc(1, sizeof(xenpaging_t));
+ if ( !paging )
+ goto err;
+
if ( getenv("XENPAGING_DEBUG") )
dbg = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, XTL_DEBUG, 0);
- xch = xc_interface_open(dbg, NULL, 0);
+
+ /* Open connection to xen */
+ paging->xc_handle = xch = xc_interface_open(dbg, NULL, 0);
if ( !xch )
- goto err_iface;
+ goto err;
DPRINTF("xenpaging init\n");
- /* Allocate memory */
- 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 )
@@ -204,9 +207,6 @@ static xenpaging_t *xenpaging_init(domid
DPRINTF("Setting policy mru_size to %d\n", paging->policy_mru_size);
}
- /* Open connection to xen */
- paging->xc_handle = xch;
-
/* Set domain id */
paging->mem_event.domain_id = domain_id;
@@ -322,7 +322,8 @@ static xenpaging_t *xenpaging_init(domid
{
if ( paging->xs_handle )
xs_close(paging->xs_handle);
- xc_interface_close(xch);
+ if ( xch )
+ xc_interface_close(xch);
if ( paging->mem_event.shared_page )
{
munlock(paging->mem_event.shared_page, PAGE_SIZE);
@@ -340,7 +341,6 @@ static xenpaging_t *xenpaging_init(domid
free(paging);
}
- err_iface:
return NULL;
}