aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2017-07-18 11:39:10 +0800
committerJuan Quintela <quintela@redhat.com>2017-07-18 17:36:26 +0200
commit6b19a7d91c8de9904c67b87203a46e55db4181ab (patch)
tree2a1d2cc759052065e8577b21c35af70d4c12b8a6 /migration
parent4e4a3d3aa691aee305f07abaf7f0a125baa585c6 (diff)
migration: check global caps for validity
Checks validity for all the capabilities that we enabled with command line. Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <1500349150-13240-11-git-send-email-peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 0ebdde18ed..76153914d1 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2166,11 +2166,27 @@ static void migration_instance_init(Object *obj)
*/
static bool migration_object_check(MigrationState *ms, Error **errp)
{
+ MigrationCapabilityStatusList *head = NULL;
+ /* Assuming all off */
+ bool cap_list[MIGRATION_CAPABILITY__MAX] = { 0 }, ret;
+ int i;
+
if (!migrate_params_check(&ms->parameters, errp)) {
return false;
}
- return true;
+ for (i = 0; i < MIGRATION_CAPABILITY__MAX; i++) {
+ if (ms->enabled_capabilities[i]) {
+ head = migrate_cap_add(head, i, true);
+ }
+ }
+
+ ret = migrate_caps_check(cap_list, head, errp);
+
+ /* It works with head == NULL */
+ qapi_free_MigrationCapabilityStatusList(head);
+
+ return ret;
}
static const TypeInfo migration_type = {