On 12/26/2014 07:42 AM, Alexander Graf wrote: > For ftell we flush the output buffer to ensure that we don't have anything > lingering in our internal buffers. This is a very safe thing to do. > > However, with the dynamic size measurement that the dynamic vmstate > description will bring this would turn out quite slow. > > Instead, we can fast path this specific measurement and just take the > internal buffers into account when telling the kernel our position. > > I'm sure I overlooked some corner cases where this doesn't work, so > instead of tuning the safe, existing version, this patch adds a fast > variant of ftell that gets used by the dynamic vmstate description code > which isn't critical when it fails. > > Signed-off-by: Alexander Graf <ag...@suse.de> > > --- > > v2 -> v3: > > - improve ftell_fast, now works with bdrv too > --- > include/migration/qemu-file.h | 1 + > migration/qemu-file.c | 16 ++++++++++++++++ > 2 files changed, 17 insertions(+)
Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature