|
|
6661d0 |
From b6e9c0ad8d498d5f50ca0aa4f05530709349adea Mon Sep 17 00:00:00 2001
|
|
|
7084e2 |
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
7084e2 |
Date: Wed, 27 Oct 2021 11:57:35 +0100
|
|
|
7084e2 |
Subject: [PATCH] vddk: Add read, write and wait asynchronous functions
|
|
|
7084e2 |
|
|
|
7084e2 |
These functions added in VDDK 6.0 - 6.5 implement asynchronous read
|
|
|
7084e2 |
and write.
|
|
|
7084e2 |
|
|
|
7084e2 |
Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
7084e2 |
(cherry picked from commit ad53e7becafed6ca3573795a79c534281fe9c274)
|
|
|
7084e2 |
---
|
|
|
7084e2 |
plugins/vddk/vddk-structs.h | 3 +++
|
|
|
7084e2 |
plugins/vddk/vddk-stubs.h | 19 ++++++++++++++++++-
|
|
|
7084e2 |
2 files changed, 21 insertions(+), 1 deletion(-)
|
|
|
7084e2 |
|
|
|
7084e2 |
diff --git a/plugins/vddk/vddk-structs.h b/plugins/vddk/vddk-structs.h
|
|
|
7084e2 |
index aeb5bfd0..e97f017c 100644
|
|
|
7084e2 |
--- a/plugins/vddk/vddk-structs.h
|
|
|
7084e2 |
+++ b/plugins/vddk/vddk-structs.h
|
|
|
7084e2 |
@@ -43,6 +43,7 @@
|
|
|
7084e2 |
|
|
|
7084e2 |
typedef uint64_t VixError;
|
|
|
7084e2 |
#define VIX_OK 0
|
|
|
7084e2 |
+#define VIX_ASYNC 25000
|
|
|
7084e2 |
|
|
|
7084e2 |
#define VIXDISKLIB_FLAG_OPEN_UNBUFFERED 1
|
|
|
7084e2 |
#define VIXDISKLIB_FLAG_OPEN_SINGLE_LINK 2
|
|
|
7084e2 |
@@ -61,6 +62,8 @@ typedef void *VixDiskLibHandle;
|
|
|
7084e2 |
|
|
|
7084e2 |
typedef void VixDiskLibGenericLogFunc (const char *fmt, va_list args);
|
|
|
7084e2 |
|
|
|
7084e2 |
+typedef void (*VixDiskLibCompletionCB) (void *data, VixError result);
|
|
|
7084e2 |
+
|
|
|
7084e2 |
enum VixDiskLibCredType {
|
|
|
7084e2 |
VIXDISKLIB_CRED_UID = 1,
|
|
|
7084e2 |
VIXDISKLIB_CRED_SESSIONID = 2,
|
|
|
7084e2 |
diff --git a/plugins/vddk/vddk-stubs.h b/plugins/vddk/vddk-stubs.h
|
|
|
7084e2 |
index a94df9cd..66353691 100644
|
|
|
7084e2 |
--- a/plugins/vddk/vddk-stubs.h
|
|
|
7084e2 |
+++ b/plugins/vddk/vddk-stubs.h
|
|
|
7084e2 |
@@ -103,10 +103,27 @@ STUB (VixDiskLib_Write,
|
|
|
7084e2 |
uint64_t start_sector, uint64_t nr_sectors,
|
|
|
7084e2 |
const unsigned char *buf));
|
|
|
7084e2 |
|
|
|
7084e2 |
-/* Added in VDDK 6.0, this will be NULL in earlier versions. */
|
|
|
7084e2 |
+/* Added in VDDK 6.0, these will be NULL in earlier versions. */
|
|
|
7084e2 |
OPTIONAL_STUB (VixDiskLib_Flush,
|
|
|
7084e2 |
VixError,
|
|
|
7084e2 |
(VixDiskLibHandle handle));
|
|
|
7084e2 |
+OPTIONAL_STUB (VixDiskLib_ReadAsync,
|
|
|
7084e2 |
+ VixError,
|
|
|
7084e2 |
+ (VixDiskLibHandle handle,
|
|
|
7084e2 |
+ uint64_t start_sector, uint64_t nr_sectors,
|
|
|
7084e2 |
+ unsigned char *buf,
|
|
|
7084e2 |
+ VixDiskLibCompletionCB callback, void *data));
|
|
|
7084e2 |
+OPTIONAL_STUB (VixDiskLib_WriteAsync,
|
|
|
7084e2 |
+ VixError,
|
|
|
7084e2 |
+ (VixDiskLibHandle handle,
|
|
|
7084e2 |
+ uint64_t start_sector, uint64_t nr_sectors,
|
|
|
7084e2 |
+ const unsigned char *buf,
|
|
|
7084e2 |
+ VixDiskLibCompletionCB callback, void *data));
|
|
|
7084e2 |
+
|
|
|
7084e2 |
+/* Added in VDDK 6.5, this will be NULL in earlier versions. */
|
|
|
7084e2 |
+OPTIONAL_STUB (VixDiskLib_Wait,
|
|
|
7084e2 |
+ VixError,
|
|
|
7084e2 |
+ (VixDiskLibHandle handle));
|
|
|
7084e2 |
|
|
|
7084e2 |
/* Added in VDDK 6.7, these will be NULL for earlier versions: */
|
|
|
7084e2 |
OPTIONAL_STUB (VixDiskLib_QueryAllocatedBlocks,
|
|
|
7084e2 |
--
|
|
|
7084e2 |
2.31.1
|
|
|
7084e2 |
|