Commit 53dd370c authored by Dr. David Alan Gilbert's avatar Dr. David Alan Gilbert Committed by Juan Quintela
Browse files

Add migration-capability boolean for postcopy-ram.



The 'postcopy ram' capability allows postcopy migration of RAM;
note that the migration starts off in precopy mode until
postcopy mode is triggered (see the migrate_start_postcopy
patch later in the series).

Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
Reviewed-by: default avatarAmit Shah <amit.shah@redhat.com>
Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
parent 7b89bf27
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -186,6 +186,7 @@ void migrate_add_blocker(Error *reason);
 */
void migrate_del_blocker(Error *reason);

bool migrate_postcopy_ram(void);
bool migrate_zero_blocks(void);

bool migrate_auto_converge(void);
+23 −0
Original line number Diff line number Diff line
@@ -578,6 +578,20 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
    for (cap = params; cap; cap = cap->next) {
        s->enabled_capabilities[cap->value->capability] = cap->value->state;
    }

    if (migrate_postcopy_ram()) {
        if (migrate_use_compression()) {
            /* The decompression threads asynchronously write into RAM
             * rather than use the atomic copies needed to avoid
             * userfaulting.  It should be possible to fix the decompression
             * threads for compatibility in future.
             */
            error_report("Postcopy is not currently compatible with "
                         "compression");
            s->enabled_capabilities[MIGRATION_CAPABILITY_X_POSTCOPY_RAM] =
                false;
        }
    }
}

void qmp_migrate_set_parameters(bool has_compress_level,
@@ -956,6 +970,15 @@ void qmp_migrate_set_downtime(double value, Error **errp)
    max_downtime = (uint64_t)value;
}

bool migrate_postcopy_ram(void)
{
    MigrationState *s;

    s = migrate_get_current();

    return s->enabled_capabilities[MIGRATION_CAPABILITY_X_POSTCOPY_RAM];
}

bool migrate_auto_converge(void)
{
    MigrationState *s;
+5 −1
Original line number Diff line number Diff line
@@ -540,11 +540,15 @@
# @auto-converge: If enabled, QEMU will automatically throttle down the guest
#          to speed up convergence of RAM migration. (since 1.6)
#
# @x-postcopy-ram: Start executing on the migration target before all of RAM has
#          been migrated, pulling the remaining pages along as needed. NOTE: If
#          the migration fails during postcopy the VM will fail.  (since 2.5)
#
# Since: 1.2
##
{ 'enum': 'MigrationCapability',
  'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
           'compress', 'events'] }
           'compress', 'events', 'x-postcopy-ram'] }

##
# @MigrationCapabilityStatus