From: Markus Armbruster Subject: Re: Missing checks for xc_map_foreign_range() failure Date: Thu, 24 Jan 2008 10:52:54 +0100 Message-ID: <871w87lfd5.fsf@pike.pond.sub.org> References: <874pifrbko.fsf@pike.pond.sub.org> <4797F549.6070501@sina.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <4797F549.6070501@sina.com.cn> (tgh's message of "Thu\, 24 Jan 2008 10\:17\:45 +0800") List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: tgh Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org tgh writes: > hi > what is the function of the xc_map_foreign_range(), what does it work > for ? could you give me someexplanation or example about it , i > encounter it in the code of xc_domain_save(), and confused about the > function of it,could you help me > > Thanks in advance xc_map_foreign_{range,pages,batch}() let you map another domain's memory, similar to mmap(). xc_map_foreign_range() is the simplest of them: it maps a range of memory starting at a mfn. You typically map one page that way, i.e. you pass PAGE_SIZE as size argument. xc_domain_save() uses it to map the domain's shared info page. That's a well-known page, and its mfn can be found in the domain's info obtained from xc_domain_getinfo().