[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v10 09/12] migration: add is_active_iterate handler
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-block] [PATCH v10 09/12] migration: add is_active_iterate handler |
Date: |
Wed, 7 Feb 2018 18:58:34 +0300 |
Only-postcopy savevm states (dirty-bitmap) don't need live iteration, so
to disable them and stop transporting empty sections there is a new
savevm handler.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
---
include/migration/register.h | 9 +++++++++
migration/savevm.c | 5 +++++
2 files changed, 14 insertions(+)
diff --git a/include/migration/register.h b/include/migration/register.h
index 9436a87678..f6f12f9b1a 100644
--- a/include/migration/register.h
+++ b/include/migration/register.h
@@ -26,6 +26,15 @@ typedef struct SaveVMHandlers {
bool (*is_active)(void *opaque);
bool (*has_postcopy)(void *opaque);
+ /* is_active_iterate
+ * If it is not NULL then qemu_savevm_state_iterate will skip iteration if
+ * it returns false. For example, it is needed for only-postcopy-states,
+ * which needs to be handled by qemu_savevm_state_setup and
+ * qemu_savevm_state_pending, but do not need iterations until not in
+ * postcopy stage.
+ */
+ bool (*is_active_iterate)(void *opaque);
+
/* This runs outside the iothread lock in the migration case, and
* within the lock in the savevm case. The callback had better only
* use data that is local to the migration thread or protected
diff --git a/migration/savevm.c b/migration/savevm.c
index c3c60a15e3..e5d557458e 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1026,6 +1026,11 @@ int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy)
continue;
}
}
+ if (se->ops && se->ops->is_active_iterate) {
+ if (!se->ops->is_active_iterate(se->opaque)) {
+ continue;
+ }
+ }
/*
* In the postcopy phase, any device that doesn't know how to
* do postcopy should have saved it's state in the _complete
--
2.11.1
- [Qemu-block] [PATCH v10 00/12] Dirty bitmaps postcopy migration, Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] [PATCH v10 07/12] migration: include migrate_dirty_bitmaps in migrate_postcopy, Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] [PATCH v10 04/12] dirty-bitmap: add locked state, Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] [PATCH v10 08/12] migration/qemu-file: add qemu_put_counted_string(), Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] [PATCH v10 12/12] iotests: add dirty bitmap postcopy test, Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] [PATCH v10 05/12] migration: introduce postcopy-only pending, Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] [PATCH v10 02/12] block/dirty-bitmap: fix locking in bdrv_reclaim_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] [PATCH v10 01/12] block/dirty-bitmap: add bdrv_dirty_bitmap_enable_successor(), Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] [PATCH v10 09/12] migration: add is_active_iterate handler,
Vladimir Sementsov-Ogievskiy <=
- [Qemu-block] [PATCH v10 03/12] block/dirty-bitmap: add _locked version of bdrv_reclaim_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] [PATCH v10 06/12] qapi: add dirty-bitmaps migration capability, Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] [PATCH v10 11/12] iotests: add dirty bitmap migration test, Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] [PATCH v10 10/12] migration: add postcopy migration of dirty bitmaps, Vladimir Sementsov-Ogievskiy, 2018/02/07
- [Qemu-block] ping Re: [PATCH v10 00/12] Dirty bitmaps postcopy migration, Vladimir Sementsov-Ogievskiy, 2018/02/15
- Re: [Qemu-block] [PATCH v10 00/12] Dirty bitmaps postcopy migration, Vladimir Sementsov-Ogievskiy, 2018/02/16