migration: ensure qemu_fflush() always writes full data amount
commitbaf51e7739a4d176284d2e38e1755afeafcd2ee0
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 27 Apr 2016 10:04:54 +0000 (27 11:04 +0100)
committerAmit Shah <amit.shah@redhat.com>
Thu, 26 May 2016 06:01:14 +0000 (26 11:31 +0530)
treee9ee8de74540a573b60d6a3e16b6c8d85217201b
parenta8ec4437cd52b2258c77d6b4195c927139c4ced5
migration: ensure qemu_fflush() always writes full data amount

The QEMUFile writev_buffer / put_buffer functions are expected
to write out the full set of requested data, blocking until
complete. The qemu_fflush() caller does not expect to deal with
partial writes. Clarify the function comments and add a sanity
check to the code to catch mistaken implementations.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <1461751518-12128-5-git-send-email-berrange@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
include/migration/qemu-file.h
migration/qemu-file.c