nbdkit/0011-vddk-Document-what-I-f...

33 lines
1.1 KiB
Diff

From 6c8f9fada5d50dc3ee5a1304420fdee3ed023d9f Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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 fc377a29..c506b5a1 100644
--- a/plugins/vddk/vddk.c
+++ b/plugins/vddk/vddk.c
@@ -957,6 +957,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, 0);
--
2.31.1