mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
savevm: introduce is_active method
Enable the creation of a method to tell migration if that section is active and should be migrate. We use it for blk-migration, that is normally not active. We don't create the method for RAM, as setups without RAM are very strange O:-) Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
9b5bfab05f
commit
6bd6878133
3 changed files with 22 additions and 7 deletions
15
savevm.c
15
savevm.c
|
@ -1576,6 +1576,11 @@ int qemu_savevm_state_begin(QEMUFile *f,
|
|||
if (!se->ops || !se->ops->save_live_state) {
|
||||
continue;
|
||||
}
|
||||
if (se->ops && se->ops->is_active) {
|
||||
if (!se->ops->is_active(se->opaque)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/* Section type */
|
||||
qemu_put_byte(f, QEMU_VM_SECTION_START);
|
||||
qemu_put_be32(f, se->section_id);
|
||||
|
@ -1618,6 +1623,11 @@ int qemu_savevm_state_iterate(QEMUFile *f)
|
|||
if (!se->ops || !se->ops->save_live_state) {
|
||||
continue;
|
||||
}
|
||||
if (se->ops && se->ops->is_active) {
|
||||
if (!se->ops->is_active(se->opaque)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (qemu_file_rate_limit(f)) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -1658,6 +1668,11 @@ int qemu_savevm_state_complete(QEMUFile *f)
|
|||
if (!se->ops || !se->ops->save_live_state) {
|
||||
continue;
|
||||
}
|
||||
if (se->ops && se->ops->is_active) {
|
||||
if (!se->ops->is_active(se->opaque)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
trace_savevm_section_start();
|
||||
/* Section type */
|
||||
qemu_put_byte(f, QEMU_VM_SECTION_END);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue