Browse Source

migration: Rename save_live_complete_precopy to save_complete

Now after merging the precopy and postcopy version of complete() hook,
rename the precopy version from save_live_complete_precopy() to
save_complete().

Dropping the "live" when at it, because it's in most cases not live when
happening (in precopy).

No functional change intended.

Reviewed-by: Juraj Marcin <jmarcin@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20250613140801.474264-7-peterx@redhat.com
[peterx: squash the fixup that covers a few more doc spots, per Juraj]
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
pull/294/head
Peter Xu 1 year ago
committed by Fabiano Rosas
parent
commit
57c43e52bd
  1. 4
      docs/devel/migration/main.rst
  2. 12
      docs/devel/migration/vfio.rst
  3. 2
      hw/ppc/spapr.c
  4. 2
      hw/s390x/s390-stattrib.c
  5. 2
      hw/vfio/migration.c
  6. 6
      include/migration/register.h
  7. 2
      migration/block-dirty-bitmap.c
  8. 2
      migration/ram.c
  9. 8
      migration/savevm.c

4
docs/devel/migration/main.rst

@ -508,8 +508,8 @@ An iterative device must provide:
the point that stream bandwidth limits tell it to stop. Each call the point that stream bandwidth limits tell it to stop. Each call
generates one section. generates one section.
- A ``save_live_complete_precopy`` function that must transmit the - A ``save_complete`` function that must transmit the last section for
last section for the device containing any remaining data. the device containing any remaining data.
- A ``load_state`` function used to load sections generated by - A ``load_state`` function used to load sections generated by
any of the save functions that generate sections. any of the save functions that generate sections.

12
docs/devel/migration/vfio.rst

@ -75,10 +75,10 @@ VFIO implements the device hooks for the iterative approach as follows:
in the non-multifd mode. in the non-multifd mode.
In the multifd mode it just emits either a dummy EOS marker. In the multifd mode it just emits either a dummy EOS marker.
* A ``save_live_complete_precopy`` function that sets the VFIO device in * A ``save_complete`` function that sets the VFIO device in _STOP_COPY
_STOP_COPY state and iteratively copies the data for the VFIO device until state and iteratively copies the data for the VFIO device until the
the vendor driver indicates that no data remains. vendor driver indicates that no data remains. In the multifd mode it
In the multifd mode it just emits a dummy EOS marker. just emits a dummy EOS marker.
* A ``save_live_complete_precopy_thread`` function that in the multifd mode * A ``save_live_complete_precopy_thread`` function that in the multifd mode
provides thread handler performing multifd device state transfer. provides thread handler performing multifd device state transfer.
@ -195,9 +195,9 @@ Live migration save path
| |
Then the VFIO device is put in _STOP_COPY state Then the VFIO device is put in _STOP_COPY state
(FINISH_MIGRATE, _ACTIVE, _STOP_COPY) (FINISH_MIGRATE, _ACTIVE, _STOP_COPY)
.save_live_complete_precopy() is called for each active device .save_complete() is called for each active device
For the VFIO device: in the non-multifd mode iterate in For the VFIO device: in the non-multifd mode iterate in
.save_live_complete_precopy() until .save_complete() until
pending data is 0 pending data is 0
In the multifd mode this iteration is done in In the multifd mode this iteration is done in
.save_live_complete_precopy_thread() instead. .save_live_complete_precopy_thread() instead.

2
hw/ppc/spapr.c

@ -2518,7 +2518,7 @@ static void htab_save_cleanup(void *opaque)
static SaveVMHandlers savevm_htab_handlers = { static SaveVMHandlers savevm_htab_handlers = {
.save_setup = htab_save_setup, .save_setup = htab_save_setup,
.save_live_iterate = htab_save_iterate, .save_live_iterate = htab_save_iterate,
.save_live_complete_precopy = htab_save_complete, .save_complete = htab_save_complete,
.save_cleanup = htab_save_cleanup, .save_cleanup = htab_save_cleanup,
.load_state = htab_load, .load_state = htab_load,
}; };

2
hw/s390x/s390-stattrib.c

@ -338,7 +338,7 @@ static const TypeInfo qemu_s390_stattrib_info = {
static SaveVMHandlers savevm_s390_stattrib_handlers = { static SaveVMHandlers savevm_s390_stattrib_handlers = {
.save_setup = cmma_save_setup, .save_setup = cmma_save_setup,
.save_live_iterate = cmma_save_iterate, .save_live_iterate = cmma_save_iterate,
.save_live_complete_precopy = cmma_save_complete, .save_complete = cmma_save_complete,
.state_pending_exact = cmma_state_pending, .state_pending_exact = cmma_state_pending,
.state_pending_estimate = cmma_state_pending, .state_pending_estimate = cmma_state_pending,
.save_cleanup = cmma_save_cleanup, .save_cleanup = cmma_save_cleanup,

2
hw/vfio/migration.c

@ -824,7 +824,7 @@ static const SaveVMHandlers savevm_vfio_handlers = {
.state_pending_exact = vfio_state_pending_exact, .state_pending_exact = vfio_state_pending_exact,
.is_active_iterate = vfio_is_active_iterate, .is_active_iterate = vfio_is_active_iterate,
.save_live_iterate = vfio_save_iterate, .save_live_iterate = vfio_save_iterate,
.save_live_complete_precopy = vfio_save_complete_precopy, .save_complete = vfio_save_complete_precopy,
.save_state = vfio_save_state, .save_state = vfio_save_state,
.load_setup = vfio_load_setup, .load_setup = vfio_load_setup,
.load_cleanup = vfio_load_cleanup, .load_cleanup = vfio_load_cleanup,

6
include/migration/register.h

@ -78,7 +78,7 @@ typedef struct SaveVMHandlers {
void (*save_cleanup)(void *opaque); void (*save_cleanup)(void *opaque);
/** /**
* @save_live_complete_precopy * @save_complete
* *
* Transmits the last section for the device containing any * Transmits the last section for the device containing any
* remaining data at the end phase of migration. * remaining data at the end phase of migration.
@ -95,7 +95,7 @@ typedef struct SaveVMHandlers {
* *
* Returns zero to indicate success and negative for error * Returns zero to indicate success and negative for error
*/ */
int (*save_live_complete_precopy)(QEMUFile *f, void *opaque); int (*save_complete)(QEMUFile *f, void *opaque);
/** /**
* @save_live_complete_precopy_thread (invoked in a separate thread) * @save_live_complete_precopy_thread (invoked in a separate thread)
@ -103,7 +103,7 @@ typedef struct SaveVMHandlers {
* Called at the end of a precopy phase from a separate worker thread * Called at the end of a precopy phase from a separate worker thread
* in configurations where multifd device state transfer is supported * in configurations where multifd device state transfer is supported
* in order to perform asynchronous transmission of the remaining data in * in order to perform asynchronous transmission of the remaining data in
* parallel with @save_live_complete_precopy handlers. * parallel with @save_complete handlers.
* When postcopy is enabled, devices that support postcopy will skip this * When postcopy is enabled, devices that support postcopy will skip this
* step. * step.
* *

2
migration/block-dirty-bitmap.c

@ -1248,7 +1248,7 @@ static bool dirty_bitmap_has_postcopy(void *opaque)
static SaveVMHandlers savevm_dirty_bitmap_handlers = { static SaveVMHandlers savevm_dirty_bitmap_handlers = {
.save_setup = dirty_bitmap_save_setup, .save_setup = dirty_bitmap_save_setup,
.save_live_complete_precopy = dirty_bitmap_save_complete, .save_complete = dirty_bitmap_save_complete,
.has_postcopy = dirty_bitmap_has_postcopy, .has_postcopy = dirty_bitmap_has_postcopy,
.state_pending_exact = dirty_bitmap_state_pending, .state_pending_exact = dirty_bitmap_state_pending,
.state_pending_estimate = dirty_bitmap_state_pending, .state_pending_estimate = dirty_bitmap_state_pending,

2
migration/ram.c

@ -4548,7 +4548,7 @@ void postcopy_preempt_shutdown_file(MigrationState *s)
static SaveVMHandlers savevm_ram_handlers = { static SaveVMHandlers savevm_ram_handlers = {
.save_setup = ram_save_setup, .save_setup = ram_save_setup,
.save_live_iterate = ram_save_iterate, .save_live_iterate = ram_save_iterate,
.save_live_complete_precopy = ram_save_complete, .save_complete = ram_save_complete,
.has_postcopy = ram_has_postcopy, .has_postcopy = ram_has_postcopy,
.state_pending_exact = ram_state_pending_exact, .state_pending_exact = ram_state_pending_exact,
.state_pending_estimate = ram_state_pending_estimate, .state_pending_estimate = ram_state_pending_estimate,

8
migration/savevm.c

@ -1496,7 +1496,7 @@ void qemu_savevm_state_complete_postcopy(QEMUFile *f)
int ret; int ret;
QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
if (!se->ops || !se->ops->save_live_complete_precopy) { if (!se->ops || !se->ops->save_complete) {
continue; continue;
} }
if (se->ops->is_active) { if (se->ops->is_active) {
@ -1509,7 +1509,7 @@ void qemu_savevm_state_complete_postcopy(QEMUFile *f)
qemu_put_byte(f, QEMU_VM_SECTION_END); qemu_put_byte(f, QEMU_VM_SECTION_END);
qemu_put_be32(f, se->section_id); qemu_put_be32(f, se->section_id);
ret = se->ops->save_live_complete_precopy(f, se->opaque); ret = se->ops->save_complete(f, se->opaque);
trace_savevm_section_end(se->idstr, se->section_id, ret); trace_savevm_section_end(se->idstr, se->section_id, ret);
save_section_footer(f, se); save_section_footer(f, se);
if (ret < 0) { if (ret < 0) {
@ -1583,7 +1583,7 @@ int qemu_savevm_state_complete_precopy_iterable(QEMUFile *f, bool in_postcopy)
if (!se->ops || if (!se->ops ||
(in_postcopy && se->ops->has_postcopy && (in_postcopy && se->ops->has_postcopy &&
se->ops->has_postcopy(se->opaque)) || se->ops->has_postcopy(se->opaque)) ||
!se->ops->save_live_complete_precopy) { !se->ops->save_complete) {
continue; continue;
} }
@ -1598,7 +1598,7 @@ int qemu_savevm_state_complete_precopy_iterable(QEMUFile *f, bool in_postcopy)
save_section_header(f, se, QEMU_VM_SECTION_END); save_section_header(f, se, QEMU_VM_SECTION_END);
ret = se->ops->save_live_complete_precopy(f, se->opaque); ret = se->ops->save_complete(f, se->opaque);
trace_savevm_section_end(se->idstr, se->section_id, ret); trace_savevm_section_end(se->idstr, se->section_id, ret);
save_section_footer(f, se); save_section_footer(f, se);
if (ret < 0) { if (ret < 0) {

Loading…
Cancel
Save