void qmp_migrate_set_cache_size(int64_t value, Error **errp)

{

    MigrationState *s = migrate_get_current();

    int64_t new_size;



    /* Check for truncation */

    if (value != (size_t)value) {

        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "exceeding address space");

        return;

    }



    /* Cache should not be larger than guest ram size */

    if (value > ram_bytes_total()) {

        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "exceeds guest ram size ");

        return;

    }



    new_size = xbzrle_cache_resize(value);

    if (new_size < 0) {

        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "is smaller than page size");

        return;

    }



    s->xbzrle_cache_size = new_size;

}

void qmp_migrate_set_cache_size(int64_t value, Error **errp)

{

    MigrationState *s = migrate_get_current();

    int64_t new_size;



    

    if (value != (size_t)value) {

        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "exceeding address space");

        return;

    }



    

    if (value > ram_bytes_total()) {

        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "exceeds guest ram size ");

        return;

    }



    new_size = xbzrle_cache_resize(value);

    if (new_size < 0) {

        error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "is smaller than page size");

        return;

    }



    s->xbzrle_cache_size = new_size;

}

void FUNC_0(int64_t VAR_0, Error **VAR_1)

{

    MigrationState *s = migrate_get_current();

    int64_t new_size;



    

    if (VAR_0 != (size_t)VAR_0) {

        error_set(VAR_1, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "exceeding address space");

        return;

    }



    

    if (VAR_0 > ram_bytes_total()) {

        error_set(VAR_1, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "exceeds guest ram size ");

        return;

    }



    new_size = xbzrle_cache_resize(VAR_0);

    if (new_size < 0) {

        error_set(VAR_1, QERR_INVALID_PARAMETER_VALUE, "cache size",

                  "is smaller than page size");

        return;

    }



    s->xbzrle_cache_size = new_size;

}

void FUNC_0(int64_t VAR_0, Error **VAR_1)
{ MigrationState *s = migrate_get_current(); int64_t new_size; if (VAR_0 != (size_t)VAR_0) { error_set(VAR_1, QERR_INVALID_PARAMETER_VALUE, "cache size",
"exceeding address space"); return; } if (VAR_0 > ram_bytes_total()) { error_set(VAR_1, QERR_INVALID_PARAMETER_VALUE, "cache size",
"exceeds guest ram size "); return; } new_size = xbzrle_cache_resize(VAR_0); if (new_size < 0) { error_set(VAR_1, QERR_INVALID_PARAMETER_VALUE, "cache size",
"is smaller than page size"); return; } s->xbzrle_cache_size = new_size; }