VirtualBox

source: vbox/trunk/src/VBox/Storage/testcase/VDIoBackend.h@ 82968

Last change on this file since 82968 was 82968, checked in by vboxsync, 5 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/** $Id: VDIoBackend.h 82968 2020-02-04 10:35:17Z vboxsync $ */
2/** @file
3 *
4 * VBox HDD container test utility, async I/O backend
5 */
6
7/*
8 * Copyright (C) 2013-2020 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef VBOX_INCLUDED_SRC_testcase_VDIoBackend_h
20#define VBOX_INCLUDED_SRC_testcase_VDIoBackend_h
21#ifndef RT_WITHOUT_PRAGMA_ONCE
22# pragma once
23#endif
24
25#include <iprt/sg.h>
26
27#include "VDDefs.h"
28
29/** I/O backend handle. */
30typedef struct VDIOBACKEND *PVDIOBACKEND;
31/** Pointer to a I/O backend handle. */
32typedef PVDIOBACKEND *PPVDIOBACKEND;
33
34/** Storage handle. */
35typedef struct VDIOSTORAGE *PVDIOSTORAGE;
36/** Pointer to a storage handle. */
37typedef PVDIOSTORAGE *PPVDIOSTORAGE;
38
39/**
40 * Completion handler.
41 *
42 * @returns nothing.
43 * @param pvUser Opaque user data.
44 * @param rcReq Completion code for the request.
45 */
46typedef DECLCALLBACK(int) FNVDIOCOMPLETE(void *pvUser, int rcReq);
47/** Pointer to a completion handler. */
48typedef FNVDIOCOMPLETE *PFNVDIOCOMPLETE;
49
50/**
51 * Creates a new memory I/O backend.
52 *
53 * @returns IPRT status code.
54 *
55 * @param ppIoBackend Where to store the handle on success.
56 */
57int VDIoBackendCreate(PPVDIOBACKEND ppIoBackend);
58
59/**
60 * Destroys a memory I/O backend.
61 *
62 * @returns nothing.
63 *
64 * @param pIoBackend The backend to destroy.
65 */
66void VDIoBackendDestroy(PVDIOBACKEND pIoBackend);
67
68int VDIoBackendStorageCreate(PVDIOBACKEND pIoBackend, const char *pszBackend,
69 const char *pszName, PFNVDIOCOMPLETE pfnComplete,
70 PPVDIOSTORAGE ppIoStorage);
71
72void VDIoBackendStorageDestroy(PVDIOSTORAGE pIoStorage);
73
74int VDIoBackendStorageSetSize(PVDIOSTORAGE pIoStorage, uint64_t cbSize);
75
76int VDIoBackendStorageGetSize(PVDIOSTORAGE pIoStorage, uint64_t *pcbSize);
77
78DECLHIDDEN(int) VDIoBackendDumpToFile(PVDIOSTORAGE pIoStorage, const char *pszPath);
79
80/**
81 * Enqueues a new I/O request.
82 *
83 * @returns IPRT status code.
84 *
85 * @param pIoStorage Storage handle.
86 * @param enmTxDir The transfer direction.
87 * @param off Start offset of the transfer.
88 * @param cbTransfer Size of the transfer.
89 * @param pSgBuf S/G buffer to use.
90 * @param pvUser Opaque user data.
91 * @param fSync Flag whether to wait for the operation to complete.
92 */
93int VDIoBackendTransfer(PVDIOSTORAGE pIoStorage, VDIOTXDIR enmTxDir, uint64_t off,
94 size_t cbTransfer, PRTSGBUF pSgBuf, void *pvUser, bool fSync);
95
96#endif /* !VBOX_INCLUDED_SRC_testcase_VDIoBackend_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette