vm-virtio: block: Ensure that VIRTIO_BLK_T_FLUSH requests actually sync

The implementation of this virtio block (and vhost-user block) command
called a function that was a no-op on Linux. Use the same function as
virtio-pmem to ensure that data is not lost when the guest asks for it
to be flused to disk.

Fixes: #399

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-05-20 10:52:13 +01:00 committed by Sebastien Boeuf
parent ca6edafbfe
commit 3947809c36

View File

@ -351,7 +351,7 @@ impl Write for RawFile {
}
fn flush(&mut self) -> std::io::Result<()> {
self.file.flush()
self.file.sync_all()
}
}