Skip to content

Commit

Permalink
migration: Introduce ignore-shared capability
Browse files Browse the repository at this point in the history
We want to use local migration to update QEMU for running guests.
In this case we don't need to migrate shared (file backed) RAM.
So, add a capability to ignore such blocks during live migration.

Signed-off-by: Yury Kotov <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Dr. David Alan Gilbert <[email protected]>
  • Loading branch information
Yury Kotov authored and dagrh committed Mar 6, 2019
1 parent 754cb9c commit 1826906
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
14 changes: 14 additions & 0 deletions migration/migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,11 @@ static bool migrate_caps_check(bool *cap_list,
error_setg(errp, "Postcopy is not supported");
return false;
}

if (cap_list[MIGRATION_CAPABILITY_X_IGNORE_SHARED]) {
error_setg(errp, "Postcopy is not compatible with ignore-shared");
return false;
}
}

return true;
Expand Down Expand Up @@ -2074,6 +2079,15 @@ bool migrate_dirty_bitmaps(void)
return s->enabled_capabilities[MIGRATION_CAPABILITY_DIRTY_BITMAPS];
}

bool migrate_ignore_shared(void)
{
MigrationState *s;

s = migrate_get_current();

return s->enabled_capabilities[MIGRATION_CAPABILITY_X_IGNORE_SHARED];
}

bool migrate_use_events(void)
{
MigrationState *s;
Expand Down
1 change: 1 addition & 0 deletions migration/migration.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ bool migrate_release_ram(void);
bool migrate_postcopy_ram(void);
bool migrate_zero_blocks(void);
bool migrate_dirty_bitmaps(void);
bool migrate_ignore_shared(void);

bool migrate_auto_converge(void);
bool migrate_use_multifd(void);
Expand Down
5 changes: 4 additions & 1 deletion qapi/migration.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,16 @@
# devices (and thus take locks) immediately at the end of migration.
# (since 3.0)
#
# @x-ignore-shared: If enabled, QEMU will not migrate shared memory (since 4.0)
#
# Since: 1.2
##
{ 'enum': 'MigrationCapability',
'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
'block', 'return-path', 'pause-before-switchover', 'x-multifd',
'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate' ] }
'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
'x-ignore-shared' ] }

##
# @MigrationCapabilityStatus:
Expand Down

0 comments on commit 1826906

Please sign in to comment.