From mboxrd@z Thu Jan 1 00:00:00 1970 From: tgh Subject: Re: code read problems Date: Sat, 01 Mar 2008 09:21:33 +0800 Message-ID: <47C8AF9D.3020809@sina.com.cn> References: <20080226095701.50167.qmail@dhost033.magnet.ch> <47C3F680.80102@sina.com.cn> <1204026247.10344.41.camel@thinkpad.localdomain> <47C52F58.1070008@sina.com.cn> <20080228185235.GA21515@ventoux.cs.ubc.ca> <47C7A9D5.7080502@sina.com.cn> <1204292349.28990.12.camel@thinkpad.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1204292349.28990.12.camel@thinkpad.localdomain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Daniel Stodden Cc: Xen Developers List-Id: xen-devel@lists.xenproject.org Thank you for your reply I encounter other confusions, 1)when I read the code of restore() in checkpoint.py for paravirt and restore() calls for the dominfo.completeRestore(),which call=20 _registerWatches(), and then call refreshShutdown(), and in refreshShutdown(),if elif xeninfo['shutdown']: and if reason=20 =3D=3D 'suspend' ,self._unwatchVM()will be called , if reason =3D=3D 'suspend': self._stateSet(DOM_STATE_SUSPENDED) # Don't destroy the domain. XendCheckpoint will d= o # this once it has finished. However, stop watchi= ng # the VM path now, otherwise we will end up with o= ne # watch for the old domain, and one for the new. self._unwatchVm() and then ,why do we call _registerWatches() before refreshShutdown(),i=20 am confused about it, and what is the function of dominfo.completeRestore()? it=20 introducedomain(),and storeDomDetails() and registerWatches()and=20 ,refreshShutdown(),and why should it refreshShutdown()?and is it that in=20 refreshShutdown(),the old domain is cleaned and destoryed, or the new=20 domain is dealt with? i am confused 2) and the code of save() in the checkpoint.py, how does the=20 saveInputHandler synchronize with the XC_SAVE ? how many times do they=20 synchronize with each other=EF=BC=9F only ,XC_SAVE sends "suspend" to=20 saveInputHandler, and then saveInputHandler send "done" to XC_SAVE =20 ,is it right? =20 def saveInputHandler(line, tochild): log.debug("In saveInputHandler %s", line) if line =3D=3D "suspend": log.debug("Suspending %d ...", dominfo.getDomid()) dominfo.shutdown('suspend') dominfo.waitForShutdown() dominfo.migrateDevices(network, dst,=20 DEV_MIGRATE_STEP2,domain_name) log.info("Domain %d suspended.", dominfo.getDomid()) dominfo.migrateDevices(network, dst,=20 DEV_MIGRATE_STEP3,domain_name) #send signal to device model for save if hvm: log.info("release_devices for hvm domain") dominfo._releaseDevices(True) tochild.write("done\n") tochild.flush() log.debug('Written done') and how many times does XC_SAVE synchronize with Handler, i read the=20 code , and just find only one time ,is it right? 3) and what is the function of the dominfo.migrateDevices with=20 DEV_MIGRATE_STEP2 and DEV_MIGRATE_STEP3, i read the code ,but still=20 confused, does it put the information of the devices into the=20 checkpoint file , or what? 4) and how does xen deal with the requests of devices in the ring and=20 gnttb and backend ,how does it store them? i have not find the code to=20 deal with it? could you help me Thanks in advance Daniel Stodden =E5=86=99=E9=81=93: > Hi. > > On Fri, 2008-02-29 at 14:44 +0800, tgh wrote: > =20 >> hi >> I read checkpoint code >> when checkpoint or migration ends,guestos continues processing by=20 >> returning back from hypercall of suspend, that is ,take_machine_down()= =20 >> call the post_suspend() to continue ,is it right? >> while in post_suspend(),pfn_to_mfn_frame_list_list[] is converted by= =20 >> virt_to_mfn(),why do this convert? i could not find where it has been=20 >> converted,and why should it be converted back? >> =20 > > No, not converted. Re-initialized.=20 > > Please compare post_suspend() with the original initialization at syste= m > boot in setup_arch() (arch/x/kernel/setup-xen.c). It should come clear > then. > > Observe that this is not canonicalization, because it is not the p2m, > but a directory containing the *machine frames* *carrying* the p2m. > Since the memory underlying the p2m has changed after resume, that > directory needs a reset. > > =20 >> and in the xc_domain_restore()in the dom0,pagetable has been=20 >> uncanonicalized, which is coupled with canonicalization in=20 >> xc_domain_save(),is it ? ,and what is the reasons for=20 >> pfn_to_mfn_frame_list_list[] virt_to_mfn in post_suspend()? >> could you help me >> =20 > > Canonicalization forth and back is done by the migration code. Keeping > the allocated frame list up to date is done by the domain itself. I do > agree that this can be confusing indeed. > > hth, > Daniel > =20 > =20