From: Mats Petersson Subject: Re: Xen source code structure Date: Thu, 12 Jul 2007 22:09:20 +0100 Message-ID: <469698b3.0589300a.7d07.ffffb31d@mx.google.com> References: <9026964a0707121354j7a2fb2e6s881cf05df9686817@mail.gmail.com> <9026964a0707121354j7a2fb2e6s881cf05df9686817@mail.gmail.co m> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Return-path: In-Reply-To: <9026964a0707121354j7a2fb2e6s881cf05df9686817@mail.gmail.co m> References: <9026964a0707121354j7a2fb2e6s881cf05df9686817@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Yi Wang , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org At 21:54 12/07/2007, Yi Wang wrote: >Hello, > >Is there any document about the structure of the Xen source code? I >downloaded the source code from >http://bits.xensource.com/oss-xen/release/3.1.0/src.tgz/xen-3.1.0-src.tgz, >but I had a hard time finding the part of code that handles the live >migration. Xen is a pretty large project, and understanding where things live can take a bit to understand. I'm writing this without looking at sources, so please treat any paths as "approximate". Live migration works with the PV/HVM save-restore concept along with some code to track writes to memory in the relevant page-table handling (in HVM case that would be the .../xen/arch/x86/mm/shadow code - not sure about PV code). Look for "logdirty", as that's the name of the method used to indicate which pages has been written to since the last transfer of "still running" domain. In the HVM case, the actual save/restore is done by the SVM/VMX code. Not sure about PV-code. The overall save/restore/migrate is initiated by the "xm" command, which is in .../tools/python/xen/xm/... (I can't remember if there is a "xm_save.py" and "xm_restore.py" or if they are part of the overall "main.py". This code executes a .../tools/xcutil/xc_{save,restore}.c which in turn calls functions in ../tools/libxc/xc_domain_{save,restore}.c I hope this does give you some idea of where to start looking. What problem are you trying to solve? -- Mats >Could anybody give me some hints? > >Thanks! > >_______________________________________________ >Xen-devel mailing list >Xen-devel@lists.xensource.com >http://lists.xensource.com/xen-devel