VirtualBox

source: vbox/trunk/src/VBox/Devices/Storage/HBDMgmt.h@ 82331

Last change on this file since 82331 was 76565, checked in by vboxsync, 6 years ago

Devices: Use VBOX_INCLUDED_SRC_ as header guard prefix with scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1/* $Id: HBDMgmt.h 76565 2019-01-01 04:23:20Z vboxsync $ */
2/** @file
3 * VBox storage devices: Host block device management API.
4 */
5
6/*
7 * Copyright (C) 2015-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef VBOX_INCLUDED_SRC_Storage_HBDMgmt_h
19#define VBOX_INCLUDED_SRC_Storage_HBDMgmt_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include <VBox/cdefs.h>
25
26RT_C_DECLS_BEGIN
27
28/**
29 * Opaque host block device manager.
30 */
31typedef struct HBDMGRINT *HBDMGR;
32/** Pointer to a block device manager. */
33typedef HBDMGR *PHBDMGR;
34
35/* NIL HBD manager handle. */
36#define NIL_HBDMGR ((HBDMGR)0)
37
38/**
39 * Creates host block device manager.
40 *
41 * @returns VBox status code.
42 * @param phHbdMgr Where to store the handle to the block device manager on success.
43 */
44DECLHIDDEN(int) HBDMgrCreate(PHBDMGR phHbdMgr);
45
46/**
47 * Destroys the given block device manager unclaiming all managed block devices.
48 *
49 * @returns nothing.
50 * @param hHbdMgr The block device manager.
51 */
52DECLHIDDEN(void) HBDMgrDestroy(HBDMGR hHbdMgr);
53
54/**
55 * Returns whether a given filename resembles a block device which can
56 * be managed by this API.
57 *
58 * @returns true if the given filename point to a block device manageable
59 * by the given manager
60 * false otherwise.
61 * @param pszFilename The block device to check.
62 */
63DECLHIDDEN(bool) HBDMgrIsBlockDevice(const char *pszFilename);
64
65/**
66 * Prepares the given block device for use by unmounting and claiming it for exclusive use.
67 *
68 * @returns VBox status code.
69 * @param hHbdMgr The block device manager.
70 * @param pszFilename The block device to claim.
71 */
72DECLHIDDEN(int) HBDMgrClaimBlockDevice(HBDMGR hHbdMgr, const char *pszFilename);
73
74/**
75 * Unclaims the given block device.
76 *
77 * @returns VBox status code.
78 * @param hHbdMgr The block device manager.
79 * @param pszFilename The block device to unclaim.
80 */
81DECLHIDDEN(int) HBDMgrUnclaimBlockDevice(HBDMGR hHbdMgr, const char *pszFilename);
82
83/**
84 * Returns whether the given block device is claimed by the manager.
85 *
86 * @returns true if the block device is claimed, false otherwisw.
87 * @param hHbdMgr The block device manager.
88 * @param pszFilename The block device to check.
89 */
90DECLHIDDEN(bool) HBDMgrIsBlockDeviceClaimed(HBDMGR hHbdMgr, const char *pszFilename);
91
92RT_C_DECLS_END
93
94#endif /* !VBOX_INCLUDED_SRC_Storage_HBDMgmt_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