mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
Split header writing out of qemu_savevm_state_begin
Split qemu_savevm_state_begin to: qemu_savevm_state_header That writes the initial file header. qemu_savevm_state_begin That sets up devices and does the first device pass. Used later in postcopy. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
b3af1bc9d2
commit
f796baa1b3
4 changed files with 11 additions and 3 deletions
|
@ -625,6 +625,13 @@ bool qemu_savevm_state_blocked(Error **errp)
|
|||
return false;
|
||||
}
|
||||
|
||||
void qemu_savevm_state_header(QEMUFile *f)
|
||||
{
|
||||
trace_savevm_state_header();
|
||||
qemu_put_be32(f, QEMU_VM_FILE_MAGIC);
|
||||
qemu_put_be32(f, QEMU_VM_FILE_VERSION);
|
||||
}
|
||||
|
||||
void qemu_savevm_state_begin(QEMUFile *f,
|
||||
const MigrationParams *params)
|
||||
{
|
||||
|
@ -639,9 +646,6 @@ void qemu_savevm_state_begin(QEMUFile *f,
|
|||
se->ops->set_params(params, se->opaque);
|
||||
}
|
||||
|
||||
qemu_put_be32(f, QEMU_VM_FILE_MAGIC);
|
||||
qemu_put_be32(f, QEMU_VM_FILE_VERSION);
|
||||
|
||||
QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
|
||||
int len;
|
||||
|
||||
|
@ -851,6 +855,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
|
|||
}
|
||||
|
||||
qemu_mutex_unlock_iothread();
|
||||
qemu_savevm_state_header(f);
|
||||
qemu_savevm_state_begin(f, ¶ms);
|
||||
qemu_mutex_lock_iothread();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue