On 12/11/2014 06:28 PM, Liang Li wrote:
> Signed-off-by: Liang Li <liang.z...@intel.com>
> Signed-off-by: Yang Zhang <yang.z.zh...@intel.com>
> ---

> +void migrate_compress_threads_create(MigrationState *s)
> +{
> +    int i, thread_count;
> +
> +    if (!migrate_use_compression()) {
> +        return;
> +    }
> +    quit_thread = false;
> +    thread_count = migrate_compress_threads();
> +    s->compress_thread = g_malloc0(sizeof(QemuThread)
> +        * thread_count);

Theoretically unsafe (well, unsafe if thread_count were unbounded,
although it looks like you artificially cap it at 255 later in the
series); better would be:

s->compress_thread = g_new0(QemuThread, thread_count)

because that catches potential multiplication overflow.

> +    comp_param = g_malloc0(sizeof(compress_param) * thread_count);

Likewise.


>  
> +static int ram_save_compressed_page(QEMUFile *f, RAMBlock* block,

Spacing is off on the second '*'.

> +        ram_addr_t offset, bool last_stage)

Indentation is off.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to