[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.
- [Qemu-devel] [PATCH 31/41] qemu-file: check exit status when closing a pipe QEMUFile, (continued)
- [Qemu-devel] [PATCH 31/41] qemu-file: check exit status when closing a pipe QEMUFile, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 39/41] migration: move contents of migration_close to migrate_fd_cleanup, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 36/41] migration: use qemu_ftell to compute bandwidth, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 38/41] migration: move rate limiting to QEMUFile, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 41/41] migration: inline migrate_fd_close, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 40/41] migration: eliminate s->migration_file, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 17/41] block-migration: document usage of state across threads, Paolo Bonzini, 2013/02/15