From 133b998d09c5949ec344c7b2ce8766cc17340dc3 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 8 Nov 2006 17:31:25 +0000 Subject: [PATCH] [XEN] Do not print grant-table warning if a page cannot be pinned because the (previous) owner is dying. This quietens down domain destruction quite a bit. Signed-off-by: Keir Fraser --- xen/common/grant_table.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 854e479f00..3b6ad11548 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -253,8 +253,12 @@ __gnttab_map_grant_ref( get_page(mfn_to_page(frame), rd) : get_page_and_type(mfn_to_page(frame), rd, PGT_writable_page))) ) - PIN_FAIL(undo_out, GNTST_general_error, - "Could not pin the granted frame (%lx)!\n", frame); + { + if ( !test_bit(_DOMF_dying, &rd->domain_flags) ) + gdprintk(XENLOG_WARNING, "Could not pin grant frame %lx\n", frame); + rc = GNTST_general_error; + goto undo_out; + } if ( op->flags & GNTMAP_host_map ) { @@ -893,8 +897,12 @@ __gnttab_copy( PIN_FAIL(error_out, GNTST_general_error, "source frame %lx invalid.\n", s_frame); if ( !get_page(mfn_to_page(s_frame), sd) ) - PIN_FAIL(error_out, GNTST_general_error, - "could not get source frame %lx.\n", s_frame); + { + if ( !test_bit(_DOMF_dying, &sd->domain_flags) ) + gdprintk(XENLOG_WARNING, "Could not get src frame %lx\n", s_frame); + rc = GNTST_general_error; + goto error_out; + } have_s_ref = 1; if ( dest_is_gref ) @@ -912,8 +920,12 @@ __gnttab_copy( PIN_FAIL(error_out, GNTST_general_error, "destination frame %lx invalid.\n", d_frame); if ( !get_page_and_type(mfn_to_page(d_frame), dd, PGT_writable_page) ) - PIN_FAIL(error_out, GNTST_general_error, - "could not get destination frame %lx.\n", d_frame); + { + if ( !test_bit(_DOMF_dying, &dd->domain_flags) ) + gdprintk(XENLOG_WARNING, "Could not get dst frame %lx\n", d_frame); + rc = GNTST_general_error; + goto error_out; + } sp = map_domain_page(s_frame); dp = map_domain_page(d_frame); -- 2.30.2