diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-03-16 14:15:18 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-03-16 14:15:18 +0000 |
commit | 9cc7d0cf6a6dc300db4db25421eff782623d6b18 (patch) | |
tree | bde6a86755607d479a93e1439cf6ed21feccbed5 /include | |
parent | 475fe4576f11e9389a188bd5698ae05458c397c2 (diff) | |
parent | ac8bd439bb7b5dffeb5ff8a17317ca2b192044b6 (diff) |
Merge remote-tracking branch 'remotes/jnsnow/tags/bitmaps-pull-request' into staging
# gpg: Signature made Tue 13 Mar 2018 21:11:43 GMT
# gpg: using RSA key 7DEF8106AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"
# Primary key fingerprint: FAEB 9711 A12C F475 812F 18F2 88A9 064D 1835 61EB
# Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76 CBD0 7DEF 8106 AAFC 390E
* remotes/jnsnow/tags/bitmaps-pull-request:
iotests: add dirty bitmap postcopy test
iotests: add dirty bitmap migration test
migration: add postcopy migration of dirty bitmaps
migration: allow qmp command migrate-start-postcopy for any postcopy
migration: add is_active_iterate handler
migration/qemu-file: add qemu_put_counted_string()
migration: include migrate_dirty_bitmaps in migrate_postcopy
qapi: add dirty-bitmaps migration capability
migration: introduce postcopy-only pending
dirty-bitmap: add locked state
block/dirty-bitmap: add _locked version of bdrv_reclaim_dirty_bitmap
block/dirty-bitmap: fix locking in bdrv_reclaim_dirty_bitmap
block/dirty-bitmap: add bdrv_dirty_bitmap_enable_successor()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/dirty-bitmap.h | 7 | ||||
-rw-r--r-- | include/migration/misc.h | 3 | ||||
-rw-r--r-- | include/migration/register.h | 26 |
3 files changed, 34 insertions, 2 deletions
diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h index 09efec609f..1ff8949b1b 100644 --- a/include/block/dirty-bitmap.h +++ b/include/block/dirty-bitmap.h @@ -21,6 +21,7 @@ BdrvDirtyBitmap *bdrv_dirty_bitmap_abdicate(BlockDriverState *bs, BdrvDirtyBitmap *bdrv_reclaim_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap, Error **errp); +void bdrv_dirty_bitmap_enable_successor(BdrvDirtyBitmap *bitmap); BdrvDirtyBitmap *bdrv_find_dirty_bitmap(BlockDriverState *bs, const char *name); void bdrv_dirty_bitmap_make_anon(BdrvDirtyBitmap *bitmap); @@ -68,6 +69,8 @@ void bdrv_dirty_bitmap_deserialize_finish(BdrvDirtyBitmap *bitmap); void bdrv_dirty_bitmap_set_readonly(BdrvDirtyBitmap *bitmap, bool value); void bdrv_dirty_bitmap_set_persistance(BdrvDirtyBitmap *bitmap, bool persistent); +void bdrv_dirty_bitmap_set_qmp_locked(BdrvDirtyBitmap *bitmap, bool qmp_locked); + /* Functions that require manual locking. */ void bdrv_dirty_bitmap_lock(BdrvDirtyBitmap *bitmap); @@ -87,10 +90,14 @@ bool bdrv_dirty_bitmap_readonly(const BdrvDirtyBitmap *bitmap); bool bdrv_has_readonly_bitmaps(BlockDriverState *bs); bool bdrv_dirty_bitmap_get_autoload(const BdrvDirtyBitmap *bitmap); bool bdrv_dirty_bitmap_get_persistance(BdrvDirtyBitmap *bitmap); +bool bdrv_dirty_bitmap_qmp_locked(BdrvDirtyBitmap *bitmap); bool bdrv_has_changed_persistent_bitmaps(BlockDriverState *bs); BdrvDirtyBitmap *bdrv_dirty_bitmap_next(BlockDriverState *bs, BdrvDirtyBitmap *bitmap); char *bdrv_dirty_bitmap_sha256(const BdrvDirtyBitmap *bitmap, Error **errp); int64_t bdrv_dirty_bitmap_next_zero(BdrvDirtyBitmap *bitmap, uint64_t start); +BdrvDirtyBitmap *bdrv_reclaim_dirty_bitmap_locked(BlockDriverState *bs, + BdrvDirtyBitmap *bitmap, + Error **errp); #endif diff --git a/include/migration/misc.h b/include/migration/misc.h index 77fd4f587c..4ebf24c6c2 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -56,4 +56,7 @@ bool migration_has_failed(MigrationState *); bool migration_in_postcopy_after_devices(MigrationState *); void migration_global_dump(Monitor *mon); +/* migration/block-dirty-bitmap.c */ +void dirty_bitmap_mig_init(void); + #endif diff --git a/include/migration/register.h b/include/migration/register.h index f4f7bdc177..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 @@ -37,8 +46,21 @@ typedef struct SaveVMHandlers { int (*save_setup)(QEMUFile *f, void *opaque); void (*save_live_pending)(QEMUFile *f, void *opaque, uint64_t threshold_size, - uint64_t *non_postcopiable_pending, - uint64_t *postcopiable_pending); + uint64_t *res_precopy_only, + uint64_t *res_compatible, + uint64_t *res_postcopy_only); + /* Note for save_live_pending: + * - res_precopy_only is for data which must be migrated in precopy phase + * or in stopped state, in other words - before target vm start + * - res_compatible is for data which may be migrated in any phase + * - res_postcopy_only is for data which must be migrated in postcopy phase + * or in stopped state, in other words - after source vm stop + * + * Sum of res_postcopy_only, res_compatible and res_postcopy_only is the + * whole amount of pending data. + */ + + LoadStateHandler *load_state; int (*load_setup)(QEMUFile *f, void *opaque); int (*load_cleanup)(void *opaque); |