xref: /openbmc/qemu/migration/options.c (revision 87dca0c9bb63014ef73ad82f7aedea1cb5a822e7)
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 
42a7a94d14SJuan Quintela bool migrate_compress(void)
43a7a94d14SJuan Quintela {
44a7a94d14SJuan Quintela     MigrationState *s;
45a7a94d14SJuan Quintela 
46a7a94d14SJuan Quintela     s = migrate_get_current();
47a7a94d14SJuan Quintela 
48a7a94d14SJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_COMPRESS];
49a7a94d14SJuan Quintela }
50a7a94d14SJuan 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 
60b890902cSJuan Quintela bool migrate_events(void)
61b890902cSJuan Quintela {
62b890902cSJuan Quintela     MigrationState *s;
63b890902cSJuan Quintela 
64b890902cSJuan Quintela     s = migrate_get_current();
65b890902cSJuan Quintela 
66b890902cSJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_EVENTS];
67b890902cSJuan Quintela }
68b890902cSJuan Quintela 
691f0776f1SJuan Quintela bool migrate_ignore_shared(void)
701f0776f1SJuan Quintela {
711f0776f1SJuan Quintela     MigrationState *s;
721f0776f1SJuan Quintela 
731f0776f1SJuan Quintela     s = migrate_get_current();
741f0776f1SJuan Quintela 
751f0776f1SJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_X_IGNORE_SHARED];
761f0776f1SJuan Quintela }
771f0776f1SJuan Quintela 
781f0776f1SJuan Quintela bool migrate_late_block_activate(void)
791f0776f1SJuan Quintela {
801f0776f1SJuan Quintela     MigrationState *s;
811f0776f1SJuan Quintela 
821f0776f1SJuan Quintela     s = migrate_get_current();
831f0776f1SJuan Quintela 
841f0776f1SJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE];
851f0776f1SJuan Quintela }
861f0776f1SJuan Quintela 
8751b07548SJuan Quintela bool migrate_multifd(void)
8851b07548SJuan Quintela {
8951b07548SJuan Quintela     MigrationState *s;
9051b07548SJuan Quintela 
9151b07548SJuan Quintela     s = migrate_get_current();
9251b07548SJuan Quintela 
9351b07548SJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_MULTIFD];
9451b07548SJuan Quintela }
9551b07548SJuan Quintela 
961f0776f1SJuan Quintela bool migrate_pause_before_switchover(void)
971f0776f1SJuan Quintela {
981f0776f1SJuan Quintela     MigrationState *s;
991f0776f1SJuan Quintela 
1001f0776f1SJuan Quintela     s = migrate_get_current();
1011f0776f1SJuan Quintela 
1021f0776f1SJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER];
1031f0776f1SJuan Quintela }
1041f0776f1SJuan Quintela 
1051f0776f1SJuan Quintela bool migrate_postcopy_blocktime(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_BLOCKTIME];
1121f0776f1SJuan Quintela }
1131f0776f1SJuan Quintela 
1141f0776f1SJuan Quintela bool migrate_postcopy_preempt(void)
1151f0776f1SJuan Quintela {
1161f0776f1SJuan Quintela     MigrationState *s;
1171f0776f1SJuan Quintela 
1181f0776f1SJuan Quintela     s = migrate_get_current();
1191f0776f1SJuan Quintela 
1201f0776f1SJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT];
1211f0776f1SJuan Quintela }
1221f0776f1SJuan Quintela 
1231f0776f1SJuan Quintela bool migrate_postcopy_ram(void)
1241f0776f1SJuan Quintela {
1251f0776f1SJuan Quintela     MigrationState *s;
1261f0776f1SJuan Quintela 
1271f0776f1SJuan Quintela     s = migrate_get_current();
1281f0776f1SJuan Quintela 
1291f0776f1SJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM];
1301f0776f1SJuan Quintela }
1311f0776f1SJuan Quintela 
1321f0776f1SJuan Quintela bool migrate_release_ram(void)
1331f0776f1SJuan Quintela {
1341f0776f1SJuan Quintela     MigrationState *s;
1351f0776f1SJuan Quintela 
1361f0776f1SJuan Quintela     s = migrate_get_current();
1371f0776f1SJuan Quintela 
1381f0776f1SJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_RELEASE_RAM];
1391f0776f1SJuan Quintela }
1401f0776f1SJuan Quintela 
1411f0776f1SJuan Quintela bool migrate_validate_uuid(void)
1421f0776f1SJuan Quintela {
1431f0776f1SJuan Quintela     MigrationState *s;
1441f0776f1SJuan Quintela 
1451f0776f1SJuan Quintela     s = migrate_get_current();
1461f0776f1SJuan Quintela 
1471f0776f1SJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_VALIDATE_UUID];
1481f0776f1SJuan Quintela }
1491f0776f1SJuan Quintela 
150*87dca0c9SJuan Quintela bool migrate_xbzrle(void)
151*87dca0c9SJuan Quintela {
152*87dca0c9SJuan Quintela     MigrationState *s;
153*87dca0c9SJuan Quintela 
154*87dca0c9SJuan Quintela     s = migrate_get_current();
155*87dca0c9SJuan Quintela 
156*87dca0c9SJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_XBZRLE];
157*87dca0c9SJuan Quintela }
158*87dca0c9SJuan Quintela 
1591f0776f1SJuan Quintela bool migrate_zero_blocks(void)
1601f0776f1SJuan Quintela {
1611f0776f1SJuan Quintela     MigrationState *s;
1621f0776f1SJuan Quintela 
1631f0776f1SJuan Quintela     s = migrate_get_current();
1641f0776f1SJuan Quintela 
1651f0776f1SJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS];
1661f0776f1SJuan Quintela }
167b4bc342cSJuan Quintela 
168b4bc342cSJuan Quintela bool migrate_zero_copy_send(void)
169b4bc342cSJuan Quintela {
170b4bc342cSJuan Quintela     MigrationState *s;
171b4bc342cSJuan Quintela 
172b4bc342cSJuan Quintela     s = migrate_get_current();
173b4bc342cSJuan Quintela 
174b4bc342cSJuan Quintela     return s->capabilities[MIGRATION_CAPABILITY_ZERO_COPY_SEND];
175b4bc342cSJuan Quintela }
176