From 7d72530453550a613ee311dd0f3bbbbc87165b1c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 26 Oct 2021 14:30:43 +0100 Subject: [PATCH] vddk: Document what I found about VixDiskLib_Flush (cherry picked from commit b79a59a81255bfd64ba403994bdf3ef4581e6535) --- plugins/vddk/vddk.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c index ee9853a7..f5fa3dfc 100644 --- a/plugins/vddk/vddk.c +++ b/plugins/vddk/vddk.c @@ -906,6 +906,14 @@ vddk_flush (void *handle, uint32_t flags) struct vddk_handle *h = handle; VixError err; + /* The documentation for Flush is missing, but the comment in the + * header file seems to indicate that it waits for WriteAsync + * commands to finish. We don't use WriteAsync, and in any case + * there's a new function Wait to wait for those. However I + * verified using strace that in fact Flush does call fsync on the + * file so it appears to be the correct call to use here. + */ + VDDK_CALL_START (VixDiskLib_Flush, "handle") { err = VixDiskLib_Flush (h->handle); } VDDK_CALL_END (VixDiskLib_Flush); -- 2.31.1