From: Markus Gross Date: Sat, 28 May 2011 08:09:40 +0000 (+0100) Subject: libxc: obtain correct length of p2m during core dumping X-Git-Tag: 4.1.1-rc2~8 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1a8205097f0e20f28e8fa97e3c2ed2cfacfb490a;p=people%2Fvhanquez%2Fxen.git libxc: obtain correct length of p2m during core dumping while implementing core dumping functionality for the libxl driver of libvirt, I discovered an issue with mapping pages of a pv guest. After dumping the core of a pv guest the domain was not cleared up properly and some pages were not unmapped. This issue is similar to the one reported here: http://lists.xensource.com/archives/html/xen-devel/2011-05/msg01314.html In xc_domain_dumpcore_via_callback in the file xc_core.c the function xc_core_arch_map_p2m is called to map P2M_FL_ENTRIES pages to the variable p2m. But to unmap the pages later, the dinfo->p2m_size has to be set accordingly. This was not done, instead a variable named p2m_size was set. This way P2M_FL_ENTRIES was always zero and the pages were left mapped. Signed-off-by: Ian Jackson Acked-by: Ian Jackson Committed-by: Ian Jackson xen-unstable changeset: 23374:8bd7b5e98f2a xen-unstable date: Tue May 24 15:00:16 2011 +0100 --- diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c index 720632de7..d711f1b72 100644 --- a/tools/libxc/xc_core.c +++ b/tools/libxc/xc_core.c @@ -468,7 +468,6 @@ xc_domain_dumpcore_via_callback(xc_interface *xch, int auto_translated_physmap; xen_pfn_t *p2m = NULL; - unsigned long p2m_size = 0; struct xen_dumpcore_p2m *p2m_array = NULL; uint64_t *pfn_array = NULL; @@ -569,7 +568,7 @@ xc_domain_dumpcore_via_callback(xc_interface *xch, } sts = xc_core_arch_map_p2m(xch, dinfo->guest_width, &info, live_shinfo, - &p2m, &p2m_size); + &p2m, &dinfo->p2m_size); if ( sts != 0 ) goto out; }