xen/24210-xenpaging_use_PERROR_to_print_errno.patch
Olaf Hering 3e2a25f4c0 - fate#310510 - fix xenpaging
24269-mem_event_move_mem_event_domain_out_of_struct_domain.patch
  24270-Free_d-mem_event_on_domain_destruction..patch

- fate#310510 - fix xenpaging
  24318-x86-mm_Fix_checks_during_foreign_mapping_of_paged_pages.patch

- fate#310510 - fix xenpaging
  23949-constify_vcpu_set_affinitys_second_parameter.patch

- fate#310510 - fix xenpaging
  24105-xenpaging_compare_domain_pointer_in_p2m_mem_paging_populate.patch
  24106-mem_event_check_capabilities_only_once.patch

- fate#310510 - fix xenpaging
  24272-xenpaging_Fix_c-s_235070a29c8c3ddf7_update_machine_to_phys_mapping_during_page_deallocation.patch

- bnc#727081 - xend domains don't work anymore since update from 12.1 beta to 12.1 RC 1
  24344-tools-x86_64_Fix_cpuid_inline_asm_to_not_clobber_stacks_red_zone.patch
  24345-tools-libxc_Fix_x86_32_build_breakage_in_previous_changeset..patch

- bnc#733449 - Panic in mcfg_ioremap when booting xen-dbg.gz on Xeon E3-1230
  24341-x86-64-mmcfg_remove___initdata_annotation_overlooked_in_23749e8d1c8f074ba.patch

- fate#310510 - fix xenpaging
  backport waitqueue changes from xen-unstable
  24104-waitqueue_Double_size_of_x86_shadow_stack..patch
  24171-x86waitqueue_Allocate_whole_page_for_shadow_stack..patch
  24195-waitqueue_Detect_saved-stack_overflow_and_crash_the_guest..patch
  24196-waitqueue_Reorder_prepare_to_wait_so_that_vcpu_is_definitely_on_the.patch
  24197-x86-waitqueue_Because_we_have_per-cpu_stacks_we_must_wake_up_on_teh.patch
  24231-waitqueue_Implement_wake_up_nroneall..patch
  24232-waitqueue_Hold_a_reference_to_a_domain_on_a_waitqueue..patch

- fate#310510 - fix xenpaging
  24227-xenpaging_restrict_pagefile_permissions.patch

- fate#310510 - fix xenpaging
  merge upstream version of our existing patches:
  24218-libxc_add_bitmap_clear_function.patch
  remove old versions:
  xenpaging.bitmap_clear.patch

- fate#310510 - fix xenpaging
  merge upstream version of our existing patches:
  24138-xenpaging_munmap_all_pages_after_page-in.patch
  24208-xenpaging_remove_filename_from_comment.patch
  24209-xenpaging_remove_obsolete_comment_in_resume_path.patch
  24210-xenpaging_use_PERROR_to_print_errno.patch
  24211-xenpaging_simplify_file_op.patch
  24212-xenpaging_print_gfn_in_failure_case.patch
  24213-xenpaging_update_xenpaging_init.patch
  24214-xenpaging_remove_xc_dominfo_t_from_paging_t.patch
  24215-xenpaging_track_the_number_of_paged-out_pages.patch
  24216-xenpaging_move_page_add-resume_loops_into_its_own_function..patch
  24217-xenpaging_improve_mainloop_exit_handling.patch
  24219-xenpaging_retry_unpageable_gfns.patch
  24220-xenpaging_install_into_LIBEXEC_dir.patch
  24221-xenpaging_add_XEN_PAGING_DIR_-_libxl_xenpaging_dir_path.patch
  24222-xenpaging_use_guests_tot_pages_as_working_target.patch
  24223-xenpaging_watch_the_guests_memory-target-tot_pages_xenstore_value.patch
  24224-xenpaging_add_cmdline_interface_for_pager.patch
  24225-xenpaging_improve_policy_mru_list_handling.patch
  24226-xenpaging_add_debug_to_show_received_watch_event..patch
  remove old versions:
  xenpaging.XEN_PAGING_DIR.patch
  xenpaging.add_evict_pages.patch
  xenpaging.cmdline-interface.patch
  xenpaging.encapsulate_domain_info.patch
  xenpaging.file_op-return-code.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

- bnc#733348 - Use 'xm' in various scripts if xend is running.
  Modified xmclone.sh and xen-updown.sh
- Only emit xl warning when xend is running and -f (force) flag
  is not specified.
  Modified disable-xl-when-using-xend.patch

- Upstream patches from Jan
  24190-hap-log-dirty-disable-rc.patch
  24193-hap-track-dirty-vram-rc.patch
  24201-x86-pcpu-platform-op.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=161
2011-12-02 20:25:29 +00:00

286 lines
9.1 KiB
Diff

changeset: 24210:d1d54cdc4a7b
user: Olaf Hering <olaf@aepfle.de>
date: Sun Nov 20 17:01:32 2011 +0100
files: tools/xenpaging/xenpaging.c
description:
xenpaging: use PERROR to print errno
v3:
- adjust arguments for xc_mem_paging_enable() failures
v2:
- move changes to file_op() to different patch
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
tools/xenpaging/xenpaging.c | 58 ++++++++++++++++++++++----------------------
1 file changed, 29 insertions(+), 29 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
@@ -90,7 +90,7 @@ static int xenpaging_wait_for_event_or_t
if (errno == EINTR)
return 0;
- ERROR("Poll exited with an error");
+ PERROR("Poll exited with an error");
return -errno;
}
@@ -121,7 +121,7 @@ static int xenpaging_wait_for_event_or_t
port = xc_evtchn_pending(xce);
if ( port == -1 )
{
- ERROR("Failed to read port from event channel");
+ PERROR("Failed to read port from event channel");
rc = -1;
goto err;
}
@@ -129,7 +129,7 @@ static int xenpaging_wait_for_event_or_t
rc = xc_evtchn_unmask(xce, port);
if ( rc < 0 )
{
- ERROR("Failed to unmask event channel port");
+ PERROR("Failed to unmask event channel port");
}
}
err:
@@ -185,7 +185,7 @@ static xenpaging_t *xenpaging_init(domid
paging->xs_handle = xs_open(0);
if ( paging->xs_handle == NULL )
{
- ERROR("Error initialising xenstore connection");
+ PERROR("Error initialising xenstore connection");
goto err;
}
@@ -193,7 +193,7 @@ static xenpaging_t *xenpaging_init(domid
snprintf(watch_token, sizeof(watch_token), "%u", domain_id);
if ( xs_watch(paging->xs_handle, "@releaseDomain", watch_token) == false )
{
- ERROR("Could not bind to shutdown watch\n");
+ PERROR("Could not bind to shutdown watch\n");
goto err;
}
@@ -214,7 +214,7 @@ static xenpaging_t *xenpaging_init(domid
paging->mem_event.shared_page = init_page();
if ( paging->mem_event.shared_page == NULL )
{
- ERROR("Error initialising shared page");
+ PERROR("Error initialising shared page");
goto err;
}
@@ -222,7 +222,7 @@ static xenpaging_t *xenpaging_init(domid
paging->mem_event.ring_page = init_page();
if ( paging->mem_event.ring_page == NULL )
{
- ERROR("Error initialising ring page");
+ PERROR("Error initialising ring page");
goto err;
}
@@ -249,7 +249,7 @@ static xenpaging_t *xenpaging_init(domid
ERROR("xenpaging not supported in a PoD guest");
break;
default:
- ERROR("Error initialising shared page: %s", strerror(errno));
+ PERROR("Error initialising shared page");
break;
}
goto err;
@@ -259,7 +259,7 @@ static xenpaging_t *xenpaging_init(domid
paging->mem_event.xce_handle = xc_evtchn_open(NULL, 0);
if ( paging->mem_event.xce_handle == NULL )
{
- ERROR("Failed to open event channel");
+ PERROR("Failed to open event channel");
goto err;
}
@@ -269,7 +269,7 @@ static xenpaging_t *xenpaging_init(domid
paging->mem_event.shared_page->port);
if ( rc < 0 )
{
- ERROR("Failed to bind event channel");
+ PERROR("Failed to bind event channel");
goto err;
}
@@ -279,7 +279,7 @@ static xenpaging_t *xenpaging_init(domid
paging->domain_info = malloc(sizeof(xc_domaininfo_t));
if ( paging->domain_info == NULL )
{
- ERROR("Error allocating memory for domain info");
+ PERROR("Error allocating memory for domain info");
goto err;
}
@@ -287,7 +287,7 @@ static xenpaging_t *xenpaging_init(domid
paging->domain_info);
if ( rc != 1 )
{
- ERROR("Error getting domain info");
+ PERROR("Error getting domain info");
goto err;
}
@@ -295,7 +295,7 @@ static xenpaging_t *xenpaging_init(domid
paging->bitmap = bitmap_alloc(paging->domain_info->max_pages);
if ( !paging->bitmap )
{
- ERROR("Error allocating bitmap");
+ PERROR("Error allocating bitmap");
goto err;
}
DPRINTF("max_pages = %"PRIx64"\n", paging->domain_info->max_pages);
@@ -311,7 +311,7 @@ static xenpaging_t *xenpaging_init(domid
rc = policy_init(paging);
if ( rc != 0 )
{
- ERROR("Error initialising policy");
+ PERROR("Error initialising policy");
goto err;
}
@@ -358,14 +358,14 @@ static int xenpaging_teardown(xenpaging_
rc = xc_mem_paging_disable(xch, paging->mem_event.domain_id);
if ( rc != 0 )
{
- ERROR("Error tearing down domain paging in xen");
+ PERROR("Error tearing down domain paging in xen");
}
/* Unbind VIRQ */
rc = xc_evtchn_unbind(paging->mem_event.xce_handle, paging->mem_event.port);
if ( rc != 0 )
{
- ERROR("Error unbinding event port");
+ PERROR("Error unbinding event port");
}
paging->mem_event.port = -1;
@@ -373,7 +373,7 @@ static int xenpaging_teardown(xenpaging_
rc = xc_evtchn_close(paging->mem_event.xce_handle);
if ( rc != 0 )
{
- ERROR("Error closing event channel");
+ PERROR("Error closing event channel");
}
paging->mem_event.xce_handle = NULL;
@@ -384,7 +384,7 @@ static int xenpaging_teardown(xenpaging_
rc = xc_interface_close(xch);
if ( rc != 0 )
{
- ERROR("Error closing connection to xen");
+ PERROR("Error closing connection to xen");
}
return 0;
@@ -444,7 +444,7 @@ static int xenpaging_evict_page(xenpagin
PROT_READ | PROT_WRITE, &gfn, 1);
if ( page == NULL )
{
- ERROR("Error mapping page");
+ PERROR("Error mapping page");
goto out;
}
@@ -452,8 +452,8 @@ static int xenpaging_evict_page(xenpagin
ret = write_page(fd, page, i);
if ( ret != 0 )
{
+ PERROR("Error copying page");
munmap(page, PAGE_SIZE);
- ERROR("Error copying page");
goto out;
}
@@ -464,7 +464,7 @@ static int xenpaging_evict_page(xenpagin
victim->gfn);
if ( ret != 0 )
{
- ERROR("Error evicting page");
+ PERROR("Error evicting page");
goto out;
}
@@ -520,7 +520,7 @@ static int xenpaging_populate_page(xenpa
sleep(1);
continue;
}
- ERROR("Error preparing for page in");
+ PERROR("Error preparing for page in");
goto out_map;
}
}
@@ -532,7 +532,7 @@ static int xenpaging_populate_page(xenpa
PROT_READ | PROT_WRITE, &gfn, 1);
if ( page == NULL )
{
- ERROR("Error mapping page: page is null");
+ PERROR("Error mapping page: page is null");
goto out_map;
}
@@ -540,7 +540,7 @@ static int xenpaging_populate_page(xenpa
ret = read_page(fd, page, i);
if ( ret != 0 )
{
- ERROR("Error reading page");
+ PERROR("Error reading page");
goto out;
}
@@ -579,7 +579,7 @@ static int evict_victim(xenpaging_t *pag
{
if ( j++ % 1000 == 0 )
if ( xenpaging_mem_paging_flush_ioemu_cache(paging) )
- ERROR("Error flushing ioemu cache");
+ PERROR("Error flushing ioemu cache");
}
}
while ( ret );
@@ -670,7 +670,7 @@ int main(int argc, char *argv[])
rc = xenpaging_wait_for_event_or_timeout(paging);
if ( rc < 0 )
{
- ERROR("Error getting event");
+ PERROR("Error getting event");
goto out;
}
else if ( rc != 0 )
@@ -710,7 +710,7 @@ int main(int argc, char *argv[])
rc = xenpaging_populate_page(paging, req.gfn, fd, i);
if ( rc != 0 )
{
- ERROR("Error populating page");
+ PERROR("Error populating page");
goto out;
}
}
@@ -723,7 +723,7 @@ int main(int argc, char *argv[])
rc = xenpaging_resume_page(paging, &rsp, 1);
if ( rc != 0 )
{
- ERROR("Error resuming page");
+ PERROR("Error resuming page");
goto out;
}
@@ -754,7 +754,7 @@ int main(int argc, char *argv[])
rc = xenpaging_resume_page(paging, &rsp, 0);
if ( rc != 0 )
{
- ERROR("Error resuming");
+ PERROR("Error resuming");
goto out;
}
}