qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v11 8/9] Add set_cachesize command


From: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH v11 8/9] Add set_cachesize command
Date: Fri, 01 Jun 2012 13:19:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

Orit Wasserman <address@hidden> 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 <address@hidden>
> Signed-off-by: Petter Svard <address@hidden>
> Signed-off-by: Aidan Shribman <address@hidden>
> Signed-off-by: Orit Wasserman <address@hidden>

> +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?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]