Skip to contentSkip to conversation

VM checkpoint image format

DISCUSSION Prateek Sharma 3 participants 5 messages Dec 21, 2013 – Jan 6, 2014

lore
Share & tools
lore
#0 lore raw

Hello all,
Is the VM-save image format specified anywhere? (the file written
to by xc_domain_save). I am looking for what fields are saved in what order.
Or is the xc_domain_save function itself the specification? Can I
change the order of fields saved (thus changing the on-disk image format) and expect no breakages? Ofcourse, I will need to change the xc_domain_restore function as well.

Thanks!
--Prateek

#1 lore raw
Quoted 11 lines · Prateek Sharma

Hello all,
Is the VM-save image format specified anywhere? (the file written
to by xc_domain_save). I am looking for what fields are saved in what order.
Or is the xc_domain_save function itself the specification? Can I
change the order of fields saved (thus changing the on-disk image format) and expect no breakages? Ofcourse, I will need to change the xc_domain_restore function as well.

Thanks!
--Prateek

There is no documentation that I am aware of, other than the code itself, and the code is a rats nest. The format itself is quite lacking in terms of extensibility, and makes some assumptions which are not actually accurate.

In my copious free time (of which I have none), or when XenServer decided that it actually wants migration which works in combination with ballooning (or any of the other more interesting memory modes), I have a plan to make a "migration protocol v2" which shall be formally specified in a document, and have ample room for forward extensibility in a backward compatible manner.

As for changing the order of things. So long as your xc_domain_save() and xc_domain_restore() have similar expectations of what order to put/find chunks of the stream, it should work fine. It would help if you described what changes you wish to make. We might be able to point you at the correct area.

~Andrew

Quoted 5 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 27 lines · Andrew Cooper
Quoted 11 lines · Prateek Sharma

Hello all,
Is the VM-save image format specified anywhere? (the file written
to by xc_domain_save). I am looking for what fields are saved in what order.
Or is the xc_domain_save function itself the specification? Can I
change the order of fields saved (thus changing the on-disk image format) and expect no breakages? Ofcourse, I will need to change the xc_domain_restore function as well.

Thanks!
--Prateek

There is no documentation that I am aware of, other than the code itself, and the code is a rats nest. The format itself is quite lacking in terms of extensibility, and makes some assumptions which are not actually accurate.

In my copious free time (of which I have none), or when XenServer decided that it actually wants migration which works in combination with ballooning (or any of the other more interesting memory modes), I have a

plan to make a "migration protocol v2" which shall be formally specified in a document, and have ample room for forward extensibility in a backward compatible manner.

Quoted 8 lines

As for changing the order of things. So long as your xc_domain_save() and xc_domain_restore() have similar expectations of what order to put/find chunks of the stream, it should work fine. It would help if you described what changes you wish to make. We might be able to point you at the correct area.

~Andrew

I'm attempting to implement VM lazy-restore. To achieve that, it would be nice if page-table pages, vcpu state, GDT pages, etc are located _before_ the rest of the pages.

Is there some implicit dependency in the ordering of pages and the VCPU context?

Is there a way to access (and hence save) all the page-table pages of a guest?

Thanks!
--Prateek

#3 lore raw
Quoted 3 lines · Prateek Sharma

Is there a way to access (and hence save) all the page-table pages of a guest?

The code in xc_domain_save.c:canonicalize_pagetable is doing something along these lines.

Ian.

#4 lore raw
In reply to Andrew Cooper
Quoted 10 lines · Andrew Cooper
Quoted 9 lines · Prateek Sharma

Hello all,
Is the VM-save image format specified anywhere? (the file written
to by xc_domain_save). I am looking for what fields are saved in what order.
Or is the xc_domain_save function itself the specification? Can I
change the order of fields saved (thus changing the on-disk image format) and expect no breakages? Ofcourse, I will need to change the xc_domain_restore function as well.

Quoted 5 lines
Quoted 2 lines

Thanks!
--Prateek

There is no documentation that I am aware of, other than the code itself,

There is a big comment in tools/libxc/xg_save_restore.h which describes the migration protocol. The save format is basically just a single pass of that.

Ian