VirtualBox

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

Last change on this file was 98718, checked in by vboxsync, 15 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 [make scm happy]

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 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 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef MAIN_INCLUDED_SRC_src_helper_apps_VBoxVolInfo_libdevmapper_h
29#define MAIN_INCLUDED_SRC_src_helper_apps_VBoxVolInfo_libdevmapper_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include <iprt/types.h>
35#include <iprt/stdarg.h>
36
37#ifndef __cplusplus
38# error "This header requires C++ to avoid name clashes."
39#endif
40
41/*
42 * Types and defines from the libdevmapper header files which we need. These are
43 * taken more or less verbatim from libdevmapper.h.
44 */
45enum
46{
47 DM_DEVICE_CREATE,
48 DM_DEVICE_RELOAD,
49 DM_DEVICE_REMOVE,
50 DM_DEVICE_REMOVE_ALL,
51 DM_DEVICE_SUSPEND,
52 DM_DEVICE_RESUME,
53 DM_DEVICE_INFO,
54 DM_DEVICE_DEPS,
55 DM_DEVICE_RENAME,
56 DM_DEVICE_VERSION,
57 DM_DEVICE_STATUS,
58 DM_DEVICE_TABLE,
59 DM_DEVICE_WAITEVENT,
60 DM_DEVICE_LIST,
61 DM_DEVICE_CLEAR,
62 DM_DEVICE_MKNODES,
63 DM_DEVICE_LIST_VERSIONS,
64 DM_DEVICE_TARGET_MSG,
65 DM_DEVICE_SET_GEOMETRY
66};
67
68struct dm_task;
69
70struct dm_info
71{
72 int exists;
73 int suspended;
74 int live_table;
75 int inactive_table;
76 int32_t open_count;
77 uint32_t event_nr;
78 uint32_t major;
79 uint32_t minor;
80 int read_only;
81 int32_t target_count;
82 int deferred_remove;
83 int internal_suspend;
84};
85
86struct dm_deps
87{
88 uint32_t count;
89 uint32_t filler;
90 RT_FLEXIBLE_ARRAY_EXTENSION
91 uint64_t device[RT_FLEXIBLE_ARRAY];
92};
93
94/* Declarations of the functions that we need from libdevmapper */
95#define VBOX_LIBDEVMAPPER_GENERATE_HEADER
96
97#include "libdevmapper-calls.h"
98
99#undef VBOX_LIBDEVMAPPER_GENERATE_HEADER
100
101#endif /* !MAIN_INCLUDED_SRC_src_helper_apps_VBoxVolInfo_libdevmapper_h */
102
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use