Orit Wasserman <owass...@redhat.com> 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 <benoit.hud...@sap.com> > Signed-off-by: Petter Svard <pett...@cs.umu.se> > Signed-off-by: Aidan Shribman <aidan.shrib...@sap.com> > Signed-off-by: Orit Wasserman <owass...@redhat.com>
> +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?