[Qemu-devel] Question in savevm.c

2014-03-13 Thread Veronia Bahaa
Hello, i need help in understanding the qemu_loadvm_state function
1- I don't get what QEMU_SECTION_START, FULL, END, PART are. I know they
are hexadecimal numbers but i don't get the meaning.
2- what's the difference between LoadStateEntry and SaveStateEntry?

Thanks!


Re: [Qemu-devel] Question in savevm.c

2014-03-13 Thread Peter Maydell
On 13 March 2014 11:05, Veronia Bahaa  wrote:
> Hello, i need help in understanding the qemu_loadvm_state function
> 1- I don't get what QEMU_SECTION_START, FULL, END, PART are. I know they are
> hexadecimal numbers but i don't get the meaning.

They're part of the file/stream format for migration data.
The stream is split into sections of various types; each
section starts with one of these type codes to tell the
incoming side what to expect next. I don't think we document
the migration stream format, so you'll have to work it out
from the source code.

> 2- what's the difference between LoadStateEntry and SaveStateEntry?

A SaveStateEntry contains the information about how to
save or load a section of migration data (roughly speaking).
When we are loading migration data we look for the
SaveStateEntry corresponding to the section ID for the
section we've just started reading, and ask it to load
the data for us.

A LoadStateEntry is just a SaveStateEntry plus a place
to store section_id and version_id; we use this data
structure on loading so that when a later section in
the stream refers to a section ID we can get at the
SaveStateEntry for it (or give an error if we haven't
seen that ID before). See the code in qemu_loadvm_state.

(Very rough summary; read the code for more detail.)

thanks
-- PMM