From mboxrd@z Thu Jan 1 00:00:00 1970 From: tgh Subject: question about dominfo.completeRestore() Date: Thu, 28 Feb 2008 21:49:39 +0800 Message-ID: <47C6BBF3.1040306@sina.com.cn> References: <20080226095701.50167.qmail@dhost033.magnet.ch> <47C3F680.80102@sina.com.cn> <1204026247.10344.41.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: <1204026247.10344.41.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-devel List-Id: xen-devel@lists.xenproject.org hi 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=20 reason =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 = do # this once it has finished. However, stop watch= ing # the VM path now, otherwise we will end up with = one # 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 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? 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? and how does xen deal with the requests of devices in the ring and gnttb=20 and backend ,how does it store them? i have not find the code to deal=20 with it? could you help me Thanks in advance