Xen Save File - VM's memory image
Hello everyone,
I'm sorry for posting this to the developer's mailing list, but I'm
almost sure that no one in the user list would be able to help me. I'm experimenting with a few VMs and I need to have access to the contents of the VMs (physical) memory that is written in the save file. I read on the mailing archives that there's no documentation on the save file format (right?). I was wondering can anyone help me by pointing me to the location in the save file that is the start of VM's memory image (e.g. X byes from the beginning/end of the file). The following:
http://lists.xensource.com/archives/html/xen-devel/2009-06/msg00839.html
mentions that someone (Tim?) has developed a set of tools for
parsing the save file. Would it be possible for me to have access to those tools and use them to extract the contents of the VM's memory?
Thanks,
Amin
Hi,
Quoted 9 lines · Amin Firoozshahian
I'm sorry for posting this to the developer's mailing list, but I'm
almost sure that no one in the user list would be able to help me. I'm experimenting with a few VMs and I need to have access to the contents of the VMs (physical) memory that is written in the save file. I read on the mailing archives that there's no documentation on the save file format (right?). I was wondering can anyone help me by pointing me to the location in the save file that is the start of VM's memory image (e.g. X byes from the beginning/end of the file). The following:
Quoted 5 lines
http://lists.xensource.com/archives/html/xen-devel/2009-06/msg00839.html
mentions that someone (Tim?) has developed a set of tools for
parsing the save file. Would it be possible for me to have access to those tools and use them to extract the contents of the VM's memory?
Sorry, the tools referred to there are for parsing Xen's HVM-state record, not libxc's VM save format. For that the only documentation is the code. :(
The memory image is not contiguous in the file, nor even in order; to get at it you'll have to strip off the xend metadata from the head of the file and then follow the xc_domain_save code to see what other fields to throw away until you get to the memory area. It's saved as lists of frame numbers followed by their contents.
Tim.
Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]
Hi Tim,
Thanks so much for the prompt reply. I was wondering whether I can
re-use the same Load VM code and redirect the output of the section which refills the VM's memory to another file. The order of pages (frames?) is not important in my experiment. If you think this is a good approach, can you please point me to the appropriate file in the Xen source that actually contains the code for reads and reloading the save file?
Regards,
Amin
Quoted 7 lines · Amin Firoozshahian
Thanks so much for the prompt reply. I was wondering whether I can
re-use the same Load VM code and redirect the output of the section which refills the VM's memory to another file. The order of pages (frames?) is not important in my experiment. If you think this is a good approach, can you please point me to the appropriate file in the Xen source that actually contains the code for reads and reloading the save file?
Yes, just hacking the load code should be fine for what you want. :) The main part of it is xc_domain_restore() in tools/libxc/xc_domain_restore.c. You'll also need to strip off Xend's metadata records from the beginning of the file before running that code.
Cheers,
Tim.
Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]