Orit Wasserman <[email protected]> wrote:
> Change XBZRLE cache size in bytes (the size should be a power of 2).
> If XBZRLE cache size is too small there will be many cache miss.
>
> Signed-off-by: Benoit Hudzia <[email protected]>
> Signed-off-by: Petter Svard <[email protected]>
> Signed-off-by: Aidan Shribman <[email protected]>
> Signed-off-by: Orit Wasserman <[email protected]>
> +void qmp_migrate_set_cachesize(int64_t value, Error **errp)
> +{
> + MigrationState *s = migrate_get_current();
> +
> + /* Check for truncation */
> + if (value != (size_t)value) {
> + error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
> + "exceeding address space");
> + return;
> + }
> +
> + value = MIN(UINT64_MAX, value);
This looks fishy to say the least. value is signed. Is there any way
that UINT64_MAX is going to be smaller than value?