11f0776f1SJuan Quintela /* 21f0776f1SJuan Quintela * QEMU migration capabilities 31f0776f1SJuan Quintela * 41f0776f1SJuan Quintela * Copyright (c) 2012-2023 Red Hat Inc 51f0776f1SJuan Quintela * 61f0776f1SJuan Quintela * Authors: 71f0776f1SJuan Quintela * Orit Wasserman <owasserm@redhat.com> 81f0776f1SJuan Quintela * Juan Quintela <quintela@redhat.com> 91f0776f1SJuan Quintela * 101f0776f1SJuan Quintela * This work is licensed under the terms of the GNU GPL, version 2 or later. 111f0776f1SJuan Quintela * See the COPYING file in the top-level directory. 121f0776f1SJuan Quintela */ 131f0776f1SJuan Quintela 141f0776f1SJuan Quintela #include "qemu/osdep.h" 151f0776f1SJuan Quintela #include "migration.h" 161f0776f1SJuan Quintela #include "options.h" 171f0776f1SJuan Quintela 181f0776f1SJuan Quintela bool migrate_auto_converge(void) 191f0776f1SJuan Quintela { 201f0776f1SJuan Quintela MigrationState *s; 211f0776f1SJuan Quintela 221f0776f1SJuan Quintela s = migrate_get_current(); 231f0776f1SJuan Quintela 241f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_AUTO_CONVERGE]; 251f0776f1SJuan Quintela } 261f0776f1SJuan Quintela 271f0776f1SJuan Quintela bool migrate_background_snapshot(void) 281f0776f1SJuan Quintela { 291f0776f1SJuan Quintela MigrationState *s; 301f0776f1SJuan Quintela 311f0776f1SJuan Quintela s = migrate_get_current(); 321f0776f1SJuan Quintela 331f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]; 341f0776f1SJuan Quintela } 351f0776f1SJuan Quintela 365e804644SJuan Quintela bool migrate_colo(void) 375e804644SJuan Quintela { 385e804644SJuan Quintela MigrationState *s = migrate_get_current(); 395e804644SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_X_COLO]; 405e804644SJuan Quintela } 415e804644SJuan Quintela 42*a7a94d14SJuan Quintela bool migrate_compress(void) 43*a7a94d14SJuan Quintela { 44*a7a94d14SJuan Quintela MigrationState *s; 45*a7a94d14SJuan Quintela 46*a7a94d14SJuan Quintela s = migrate_get_current(); 47*a7a94d14SJuan Quintela 48*a7a94d14SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_COMPRESS]; 49*a7a94d14SJuan Quintela } 50*a7a94d14SJuan Quintela 511f0776f1SJuan Quintela bool migrate_dirty_bitmaps(void) 521f0776f1SJuan Quintela { 531f0776f1SJuan Quintela MigrationState *s; 541f0776f1SJuan Quintela 551f0776f1SJuan Quintela s = migrate_get_current(); 561f0776f1SJuan Quintela 571f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_DIRTY_BITMAPS]; 581f0776f1SJuan Quintela } 591f0776f1SJuan Quintela 601f0776f1SJuan Quintela bool migrate_ignore_shared(void) 611f0776f1SJuan Quintela { 621f0776f1SJuan Quintela MigrationState *s; 631f0776f1SJuan Quintela 641f0776f1SJuan Quintela s = migrate_get_current(); 651f0776f1SJuan Quintela 661f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_X_IGNORE_SHARED]; 671f0776f1SJuan Quintela } 681f0776f1SJuan Quintela 691f0776f1SJuan Quintela bool migrate_late_block_activate(void) 701f0776f1SJuan Quintela { 711f0776f1SJuan Quintela MigrationState *s; 721f0776f1SJuan Quintela 731f0776f1SJuan Quintela s = migrate_get_current(); 741f0776f1SJuan Quintela 751f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE]; 761f0776f1SJuan Quintela } 771f0776f1SJuan Quintela 781f0776f1SJuan Quintela bool migrate_pause_before_switchover(void) 791f0776f1SJuan Quintela { 801f0776f1SJuan Quintela MigrationState *s; 811f0776f1SJuan Quintela 821f0776f1SJuan Quintela s = migrate_get_current(); 831f0776f1SJuan Quintela 841f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER]; 851f0776f1SJuan Quintela } 861f0776f1SJuan Quintela 871f0776f1SJuan Quintela bool migrate_postcopy_blocktime(void) 881f0776f1SJuan Quintela { 891f0776f1SJuan Quintela MigrationState *s; 901f0776f1SJuan Quintela 911f0776f1SJuan Quintela s = migrate_get_current(); 921f0776f1SJuan Quintela 931f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME]; 941f0776f1SJuan Quintela } 951f0776f1SJuan Quintela 961f0776f1SJuan Quintela bool migrate_postcopy_preempt(void) 971f0776f1SJuan Quintela { 981f0776f1SJuan Quintela MigrationState *s; 991f0776f1SJuan Quintela 1001f0776f1SJuan Quintela s = migrate_get_current(); 1011f0776f1SJuan Quintela 1021f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT]; 1031f0776f1SJuan Quintela } 1041f0776f1SJuan Quintela 1051f0776f1SJuan Quintela bool migrate_postcopy_ram(void) 1061f0776f1SJuan Quintela { 1071f0776f1SJuan Quintela MigrationState *s; 1081f0776f1SJuan Quintela 1091f0776f1SJuan Quintela s = migrate_get_current(); 1101f0776f1SJuan Quintela 1111f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM]; 1121f0776f1SJuan Quintela } 1131f0776f1SJuan Quintela 1141f0776f1SJuan Quintela bool migrate_release_ram(void) 1151f0776f1SJuan Quintela { 1161f0776f1SJuan Quintela MigrationState *s; 1171f0776f1SJuan Quintela 1181f0776f1SJuan Quintela s = migrate_get_current(); 1191f0776f1SJuan Quintela 1201f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_RELEASE_RAM]; 1211f0776f1SJuan Quintela } 1221f0776f1SJuan Quintela 1231f0776f1SJuan Quintela bool migrate_validate_uuid(void) 1241f0776f1SJuan Quintela { 1251f0776f1SJuan Quintela MigrationState *s; 1261f0776f1SJuan Quintela 1271f0776f1SJuan Quintela s = migrate_get_current(); 1281f0776f1SJuan Quintela 1291f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_VALIDATE_UUID]; 1301f0776f1SJuan Quintela } 1311f0776f1SJuan Quintela 1321f0776f1SJuan Quintela bool migrate_zero_blocks(void) 1331f0776f1SJuan Quintela { 1341f0776f1SJuan Quintela MigrationState *s; 1351f0776f1SJuan Quintela 1361f0776f1SJuan Quintela s = migrate_get_current(); 1371f0776f1SJuan Quintela 1381f0776f1SJuan Quintela return s->capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS]; 1391f0776f1SJuan Quintela } 140