WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] migration and restore?

thank both of you

and how to debug python, i could debug c program with gdb ,and how to
debug python program?

and ,does the code of xc_domain_save.c and xc_domain_restore.c do the
same job as the xend "xm save " and "xm restore"? and what are the valid
parameter for it ? i look through the code ,it seems to be able to save
VM in a live way ,and i try for some parameter , but failed , and how to
do it?

[root@vt-0 ~]# cd /root/xen-build-tree/xen-3.1.0-src/tools/xcutils/
[root@vt-0 xcutils]# ls
Makefile readnotes.c xc_restore xc_restore.o xc_save.c
readnotes readnotes.o xc_restore.c xc_save xc_save.o
[root@vt-0 xcutils]# ./xc_save /tmp
xc_save: usage: ./xc_save iofd domid maxit maxf flags
[root@vt-0 xcutils]# ./xc_save /tmp/dom-1 dom-1 2 2 1
ERROR Internal error: Couldn't map live_shinfo
Warning - couldn't disable shadow modeSave exit rc=1
[root@vt-0 xcutils]# ./xc_save /tmp/dom-1 dom-1 1 1 1
ERROR Internal error: Couldn't map live_shinfo
Warning - couldn't disable shadow modeSave exit rc=1
[root@vt-0 xcutils]# ./xc_save /tmp/dom-1 dom-1 1 1 0
ERROR Internal error: Couldn't map live_shinfo
Save exit rc=1
[root@vt-0 xcutils]#





Thanks


Daniel Stodden 写道:
> On Tue, 2008-01-08 at 13:16 +0100, Andre Przywara wrote:
>   
>>> i read the code of migration, and i fail to find the counterpart code of 
>>> migration , which deal with the restoration of VM in the destination 
>>> node, and i read the code of /tools/libxc/xc_domain_restore.c ,but the 
>>> function of xc_domain_restore() seems not to be the one for the 
>>> migration, it seems not support the restore of the iterative copy of the 
>>> VM memory state ,is it? or how does it deal with the work?
>>>       
>> Maybe the missing pieces you are looking for are in the xend (Python) 
>> code? In line 205 (or so) in tools/pyhton/xen/xend/XendDomainInfo.py you 
>> will find the high level function "restore". This method calls 
>> XendDomainInfo.resume (line 446) and triggers the necessary actions 
>> here. Another file to look in is XendCheckpoint.py, here you'll find the 
>> method "restore" (line 154). Some Migration code is also in XendDomain.py.
>> You can get more info if you enable debugging, do a live migration (to 
>> localhost) and look in xend.log for "Saving memory pages" or "Reloading 
>> memory pages". From here you will find the corresponding code (maybe by 
>> just grepping for the log message text).
>> I found line 427 in xc_domain_restore.c, the code following this line 
>> deals with the restoring of the frames. From my perspective there is 
>> everything needed in there.
>>     
>
> this is correct, the iteration is definitely done in
> xc_domain_restore().
>
> the for loop as described above follows iteration as dictated by the
> source machine. each interation generates a number of batches, each
> batch comprising a number of pages, either first try or (later) resent
> due to being dirtied. each batch is dispatched in several passes. the
> second pass generates the machine frame list into which the batch is
> read. the most interesting part where that memory is mapped and filled
> with frame contents starts in line 533 (xc_map_foreign_range) and the
> subsequent for-loop in line 544 resp.
>
> complete enough to follow without the addtional setup done by xend.
> tools/xcutils/ contains C programs calling into the library for save and
> restore. should be easy to call from the command line once the parameter
> meanings are understood; i'd suggest to build with debug output enabled
> and follow the stderr messages to see how it works.
>
> regards,
> daniel
>
>
>   


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>