VirtualBox

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

Last change on this file since 96973 was 96407, checked in by vboxsync, 2 years ago

scm copyright and license note update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/** $Id: VDIoBackend.h 96407 2022-08-22 17:43:14Z vboxsync $ */
2/** @file
3 *
4 * VBox HDD container test utility, async I/O backend
5 */
6
7/*
8 * Copyright (C) 2013-2022 Oracle and/or its affiliates.
9 *
10 * This file is part of VirtualBox base platform packages, as
11 * available from https://www.virtualbox.org.
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation, in version 3 of the
16 * License.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, see <https://www.gnu.org/licenses>.
25 *
26 * SPDX-License-Identifier: GPL-3.0-only
27 */
28
29#ifndef VBOX_INCLUDED_SRC_testcase_VDIoBackend_h
30#define VBOX_INCLUDED_SRC_testcase_VDIoBackend_h
31#ifndef RT_WITHOUT_PRAGMA_ONCE
32# pragma once
33#endif
34
35#include <iprt/sg.h>
36
37#include "VDDefs.h"
38
39/** I/O backend handle. */
40typedef struct VDIOBACKEND *PVDIOBACKEND;
41/** Pointer to a I/O backend handle. */
42typedef PVDIOBACKEND *PPVDIOBACKEND;
43
44/** Storage handle. */
45typedef struct VDIOSTORAGE *PVDIOSTORAGE;
46/** Pointer to a storage handle. */
47typedef PVDIOSTORAGE *PPVDIOSTORAGE;
48
49/**
50 * Completion handler.
51 *
52 * @returns nothing.
53 * @param pvUser Opaque user data.
54 * @param rcReq Completion code for the request.
55 */
56typedef DECLCALLBACKTYPE(int, FNVDIOCOMPLETE,(void *pvUser, int rcReq));
57/** Pointer to a completion handler. */
58typedef FNVDIOCOMPLETE *PFNVDIOCOMPLETE;
59
60/**
61 * Creates a new memory I/O backend.
62 *
63 * @returns IPRT status code.
64 *
65 * @param ppIoBackend Where to store the handle on success.
66 */
67int VDIoBackendCreate(PPVDIOBACKEND ppIoBackend);
68
69/**
70 * Destroys a memory I/O backend.
71 *
72 * @returns nothing.
73 *
74 * @param pIoBackend The backend to destroy.
75 */
76void VDIoBackendDestroy(PVDIOBACKEND pIoBackend);
77
78int VDIoBackendStorageCreate(PVDIOBACKEND pIoBackend, const char *pszBackend,
79 const char *pszName, PFNVDIOCOMPLETE pfnComplete,
80 PPVDIOSTORAGE ppIoStorage);
81
82void VDIoBackendStorageDestroy(PVDIOSTORAGE pIoStorage);
83
84int VDIoBackendStorageSetSize(PVDIOSTORAGE pIoStorage, uint64_t cbSize);
85
86int VDIoBackendStorageGetSize(PVDIOSTORAGE pIoStorage, uint64_t *pcbSize);
87
88DECLHIDDEN(int) VDIoBackendDumpToFile(PVDIOSTORAGE pIoStorage, const char *pszPath);
89
90/**
91 * Enqueues a new I/O request.
92 *
93 * @returns IPRT status code.
94 *
95 * @param pIoStorage Storage handle.
96 * @param enmTxDir The transfer direction.
97 * @param off Start offset of the transfer.
98 * @param cbTransfer Size of the transfer.
99 * @param pSgBuf S/G buffer to use.
100 * @param pvUser Opaque user data.
101 * @param fSync Flag whether to wait for the operation to complete.
102 */
103int VDIoBackendTransfer(PVDIOSTORAGE pIoStorage, VDIOTXDIR enmTxDir, uint64_t off,
104 size_t cbTransfer, PRTSGBUF pSgBuf, void *pvUser, bool fSync);
105
106#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