qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 38/41] migration: move rate limiting to QEMUFile


From: Juan Quintela
Subject: Re: [Qemu-devel] [PATCH 38/41] migration: move rate limiting to QEMUFile
Date: Fri, 22 Feb 2013 12:42:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Paolo Bonzini <address@hidden> wrote:
> Rate limiting is now simply a byte counter; client call
> qemu_file_rate_limit() manually to determine if they have to exit.
> So it is possible and simple to move the functionality to QEMUFile.
>
> This makes the remaining functionality of s->file redundant;
> in the next patch we can remove it and write directly to s->migration_file.
>
> Signed-off-by: Paolo Bonzini <address@hidden>

Reviewed-by: Juan Quintela <address@hidden>


Nice!!!

>      qemu_put_buffer(s->migration_file, buf, size);
> -    if (qemu_file_get_error(s->migration_file)) {
> -        return qemu_file_get_error(s->migration_file);
> -    }
> -
> -    s->bytes_xfer += size;
> -    return size;
> +    return qemu_file_get_error(s->migration_file);
>  }

You fix here the problem that I pointed in a previous patch, so feel
free not to fix it in the previous one.

If anyone reading this, just thinking aloud, this function is called as

    if (f->is_write && f->buf_index > 0) {
        ret = f->ops->put_buffer(f->opaque, f->buf, f->buf_offset, 
f->buf_index);
        if (ret >= 0) {
            f->buf_offset += f->buf_index;
        }
        f->buf_index = 0;

So the change from "size" to "0" on the non-error case don't matter.





reply via email to

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