]> git.proxmox.com Git - mirror_qemu.git/commit - migration/qemu-file.c
Make qemu_peek_buffer loop until it gets it's data
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Tue, 8 Apr 2014 14:29:37 +0000 (15:29 +0100)
committerJuan Quintela <quintela@redhat.com>
Mon, 5 May 2014 20:15:03 +0000 (22:15 +0200)
commit548f52ea06951c20f0b91cae6cde0512ec073c83
treea649287d400605d0274a0c10b574260983351282
parentca99993adc9205c905dba5dc1bb819959ada7200
Make qemu_peek_buffer loop until it gets it's data

Make qemu_peek_buffer repeatedly call fill_buffer until it gets
all the data it requires, or until there is an error.

  At the moment, qemu_peek_buffer will try one qemu_fill_buffer if there
  isn't enough data waiting, however the kernel is entitled to return
  just a few bytes, and still leave qemu_peek_buffer with less bytes
  than it needed.  I've seen this fail in a dev world, and I think it
  could theoretically fail in the peeking of the subsection headers in
  the current world.

Comment qemu_peek_byte to point out it's not guaranteed to work for
  non-continuous peeks

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: ChenLiang <chenliang0016@icloud.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
include/migration/qemu-file.h
qemu-file.c