From: Keir Fraser Subject: Re: What actually destroys a domain? Date: Wed, 13 Sep 2006 13:15:13 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , Jimi Xenidis Cc: xen-devel@lists.xensource.com, xen-ppc-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 13/9/06 10:23, "Keir Fraser" wrote: >>> >>> Xenconsoled's mapping of the console page should keep the domain >>> alive. >>> >> hmm, I'm having trouble associating the "mapping" and a refcount of >> some sort somewhere, any pointers? > > See share_xen_page_with_guest() in arch/x86/mm.c. The refcnt is dropped when > xenheap_pages field reduces to zero in > common/page_alloc.c:free_domheap_pages(). Sorry, I'm talking rubbish here. As you say, the relevant code is actually in the foreign mapping paths (e.g., in arch/x86/mm.c). Those paths do a get_page() on the foreign page. This stops it being removed from the domU page list. A non-empty page list holds a reference on the domU. So the domU will not die until that foreign mapping is destroyed. -- Keir