VirtualBox

source: vbox/trunk/src/VBox/Storage/testcase/VDIoBackendMem.h@ 80074

Last change on this file since 80074 was 76578, checked in by vboxsync, 6 years ago

Storage: scm --guard-relative-to-dir {parent}

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1/** $Id: VDIoBackendMem.h 76578 2019-01-01 06:11:47Z vboxsync $ */
2/** @file
3 *
4 * VBox HDD container test utility, async I/O memory backend
5 */
6
7/*
8 * Copyright (C) 2011-2019 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_VDIoBackendMem_h
20#define VBOX_INCLUDED_SRC_testcase_VDIoBackendMem_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/** Memory backend handle. */
30typedef struct VDIOBACKENDMEM *PVDIOBACKENDMEM;
31/** Pointer to a memory backend handle. */
32typedef PVDIOBACKENDMEM *PPVDIOBACKENDMEM;
33
34/**
35 * Completion handler.
36 *
37 * @returns nothing.
38 * @param pvUser Opaque user data.
39 * @param rcReq Completion code for the request.
40 */
41typedef DECLCALLBACK(int) FNVDIOCOMPLETE(void *pvUser, int rcReq);
42/** Pointer to a completion handler. */
43typedef FNVDIOCOMPLETE *PFNVDIOCOMPLETE;
44
45/**
46 * Creates a new memory I/O backend.
47 *
48 * @returns IPRT status code.
49 *
50 * @param ppIoBackend Where to store the handle on success.
51 */
52int VDIoBackendMemCreate(PPVDIOBACKENDMEM ppIoBackend);
53
54/**
55 * Destroys a memory I/O backend.
56 *
57 * @returns IPRT status code.
58 *
59 * @param pIoBackend The backend to destroy.
60 */
61int VDIoBackendMemDestroy(PVDIOBACKENDMEM pIoBackend);
62
63/**
64 * Enqueues a new I/O request.
65 *
66 * @returns IPRT status code.
67 *
68 * @param pIoBackend The backend which should handle the
69 * transfer.
70 * @param pMemDisk The memory disk the request is for.
71 * @param enmTxDir The transfer direction.
72 * @param off Start offset of the transfer.
73 * @param cbTransfer Size of the transfer.
74 * @param pSgBuf S/G buffer to use.
75 * @param pfnComplete Completion handler to call.
76 * @param pvUser Opaque user data.
77 */
78int VDIoBackendMemTransfer(PVDIOBACKENDMEM pIoBackend, PVDMEMDISK pMemDisk,
79 VDIOTXDIR enmTxDir, uint64_t off, size_t cbTransfer,
80 PRTSGBUF pSgBuf, PFNVDIOCOMPLETE pfnComplete, void *pvUser);
81
82#endif /* !VBOX_INCLUDED_SRC_testcase_VDIoBackendMem_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