VirtualBox

source: vbox/trunk/src/VBox/Main/src-helper-apps/VBoxVolInfo/libdevmapper.h@ 98717

Last change on this file since 98717 was 98717, checked in by vboxsync, 16 months ago

Main/VBoxVolInfo: Don't link directly against libdevmapper but use the IPRT runtime loader to get rid of the buildtime dependency, bugref:10367

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/** @file
2 * Module to dynamically load libdevmapper and load all symbols which are needed by
3 * VirtualBox.
4 */
5
6/*
7 * Copyright (C) 2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * The contents of this file may alternatively be used under the terms
26 * of the Common Development and Distribution License Version 1.0
27 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
28 * in the VirtualBox distribution, in which case the provisions of the
29 * CDDL are applicable instead of those of the GPL.
30 *
31 * You may elect to license modified versions of this file under the
32 * terms and conditions of either the GPL or the CDDL or both.
33 *
34 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
35 */
36
37#ifndef VBOX_INCLUDED_libdevmapper_h
38#define VBOX_INCLUDED_libdevmapper_h
39#ifndef RT_WITHOUT_PRAGMA_ONCE
40# pragma once
41#endif
42
43#include <iprt/types.h>
44#include <iprt/stdarg.h>
45
46#ifndef __cplusplus
47# error "This header requires C++ to avoid name clashes."
48#endif
49
50/*
51 * Types and defines from the libdevmapper header files which we need. These are
52 * taken more or less verbatim from libdevmapper.h.
53 */
54enum
55{
56 DM_DEVICE_CREATE,
57 DM_DEVICE_RELOAD,
58 DM_DEVICE_REMOVE,
59 DM_DEVICE_REMOVE_ALL,
60 DM_DEVICE_SUSPEND,
61 DM_DEVICE_RESUME,
62 DM_DEVICE_INFO,
63 DM_DEVICE_DEPS,
64 DM_DEVICE_RENAME,
65 DM_DEVICE_VERSION,
66 DM_DEVICE_STATUS,
67 DM_DEVICE_TABLE,
68 DM_DEVICE_WAITEVENT,
69 DM_DEVICE_LIST,
70 DM_DEVICE_CLEAR,
71 DM_DEVICE_MKNODES,
72 DM_DEVICE_LIST_VERSIONS,
73 DM_DEVICE_TARGET_MSG,
74 DM_DEVICE_SET_GEOMETRY
75};
76
77struct dm_task;
78
79struct dm_info
80{
81 int exists;
82 int suspended;
83 int live_table;
84 int inactive_table;
85 int32_t open_count;
86 uint32_t event_nr;
87 uint32_t major;
88 uint32_t minor;
89 int read_only;
90 int32_t target_count;
91 int deferred_remove;
92 int internal_suspend;
93};
94
95struct dm_deps
96{
97 uint32_t count;
98 uint32_t filler;
99 RT_FLEXIBLE_ARRAY_EXTENSION
100 uint64_t device[RT_FLEXIBLE_ARRAY];
101};
102
103/* Declarations of the functions that we need from libdevmapper */
104#define VBOX_LIBDEVMAPPER_GENERATE_HEADER
105
106#include "libdevmapper-calls.h"
107
108#undef VBOX_LIBDEVMAPPER_GENERATE_HEADER
109
110#endif /* !VBOX_INCLUDED_libdevmapper_h */
111
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use