xen/xenpaging.guest-memusage.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

81 lines
2.8 KiB
Diff

---
tools/xenpaging/Makefile | 2 -
tools/xenpaging/xenmem.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+), 1 deletion(-)
Index: xen-4.1.2-testing/tools/xenpaging/Makefile
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/Makefile
+++ xen-4.1.2-testing/tools/xenpaging/Makefile
@@ -20,7 +20,7 @@ CFLAGS += -Wp,-MD,.$(@F).d
DEPS = .*.d
OBJS = $(SRCS:.c=.o)
-IBINS = xenpaging
+IBINS = xenpaging xenmem
all: $(IBINS)
Index: xen-4.1.2-testing/tools/xenpaging/xenmem.c
===================================================================
--- /dev/null
+++ xen-4.1.2-testing/tools/xenpaging/xenmem.c
@@ -0,0 +1,57 @@
+#include <stdio.h>
+#include <xc_private.h>
+
+static void dump_mem(const char *domid)
+{
+ xc_interface *xch;
+ xc_dominfo_t info;
+ unsigned char handle[16];
+ char uuid[16 * 2 + 1];
+ int i;
+
+ xch = xc_interface_open(NULL, NULL, 0);
+ if (!xch)
+ perror("xc_interface_open");
+ else {
+ i = xc_domain_getinfo(xch, atoi(domid), 1, &info);
+ if (i != 1)
+ perror("xc_domain_getinfo");
+ else {
+ printf("domid\t%u\n", info.domid);
+ printf("ssidref\t%u\n", info.ssidref);
+ printf("dying\t%u\n", info.dying);
+ printf("crashed\t%u\n", info.crashed);
+ printf("shutdown\t%u\n", info.shutdown);
+ printf("paused\t%u\n", info.paused);
+ printf("blocked\t%u\n", info.blocked);
+ printf("running\t%u\n", info.running);
+ printf("hvm\t%u\n", info.hvm);
+ printf("debugged\t%u\n", info.debugged);
+ printf("shutdown_reason\t%u\n", info.shutdown_reason);
+ printf("nr_pages\t%lu\t%lu KiB\t%lu MiB\n", info.nr_pages, info.nr_pages * 4, info.nr_pages * 4 / 1024);
+ printf("nr_shared_pages\t%lu\t%lu KiB\t%lu MiB\n", info.nr_shared_pages, info.nr_shared_pages * 4, info.nr_shared_pages * 4 / 1024);
+ printf("nr_paged_pages\t%lu\t%lu KiB\t%lu MiB\n", info.nr_paged_pages, info.nr_paged_pages * 4, info.nr_paged_pages * 4 / 1024);
+ printf("max_memkb\t%lu KiB\t%lu MiB\n", info.max_memkb, info.max_memkb / 1024);
+ printf("shared_info_frame\t%lu\t%lx\n", info.shared_info_frame, info.shared_info_frame);
+ printf("cpu_time\t%llu\t%016llx\n", (unsigned long long)info.cpu_time, (unsigned long long)info.cpu_time);
+ printf("nr_online_vcpus\t%u\n", info.nr_online_vcpus);
+ printf("max_vcpu_id\t%u\n", info.max_vcpu_id);
+ printf("cpupool\t%u\n", info.cpupool);
+
+ memcpy(&handle, &info.handle, sizeof(handle));
+ uuid[0] = '\0';
+ for (i = 0; i < sizeof(handle); i++)
+ snprintf(&uuid[i * 2], sizeof(uuid) - strlen(uuid), "%02x", handle[i]);
+ printf("handle\t%s\n", uuid);
+ }
+ if (xc_interface_close(xch) < 0)
+ perror("xc_interface_close");
+ }
+}
+
+int main(int argc, char **argv)
+{
+ if (argv[1])
+ dump_mem(argv[1]);
+ return 0;
+}