On 10/10/2011 01:56 AM, Michael S. Tsirkin wrote:
qemu file currently always buffers up data before writing it out.
At least for memory this is probably not a good idea:
writing out to file would be cheaper. Let's do
that if we can, which should be the common case. If we can't, buffer.

Signed-off-by: Michael S. Tsirkin<m...@redhat.com>

---

Completely untested, this is just thinking aloud.
Shouldn't the below save us a data copy in the
common case, helping speed up migration?

The problem here is qemu_put_byte and friends, where the indirection of a function call would probably slow things down. In the common case, qemu_put_byte is called a lot and f->buf_index would not be zero. The way to go would probably be to merge QEMUFile and QEMUBufferedFile's two buffering layers, which also removes a copy.

Paolo

Reply via email to