[98717] | 1 | /** @file
|
---|
| 2 | * Stubs for dynamically loading libdevmapper and the 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 | *
|
---|
[98718] | 25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
[98717] | 26 | */
|
---|
| 27 |
|
---|
[98721] | 28 |
|
---|
[98717] | 29 | /** The file name of the libdevmapper library */
|
---|
| 30 | #define RT_RUNTIME_LOADER_LIB_NAME "libdevmapper.so"
|
---|
| 31 |
|
---|
| 32 | /** The name of the loader function */
|
---|
| 33 | #define RT_RUNTIME_LOADER_FUNCTION RTDevmapperLoadLib
|
---|
| 34 |
|
---|
| 35 | /** The following are the symbols which we need from the libdevmapper library. */
|
---|
| 36 | #define RT_RUNTIME_LOADER_INSERT_SYMBOLS \
|
---|
| 37 | RT_PROXY_STUB(dm_task_create, struct dm_task *, (int type), \
|
---|
| 38 | (type)) \
|
---|
| 39 | RT_PROXY_STUB(dm_task_set_name, int, (struct dm_task *dmt, const char *name), \
|
---|
| 40 | (dmt, name)) \
|
---|
| 41 | RT_PROXY_STUB(dm_task_run, int, \
|
---|
| 42 | (struct dm_task *dmt), (dmt)) \
|
---|
| 43 | RT_PROXY_STUB(dm_task_get_info, int, \
|
---|
| 44 | (struct dm_task *dmt, struct dm_info *dmi), (dmt, dmi)) \
|
---|
| 45 | RT_PROXY_STUB(dm_task_get_deps, struct dm_deps *, (struct dm_task *dmt), \
|
---|
| 46 | (dmt)) \
|
---|
| 47 | RT_PROXY_STUB(dm_task_destroy, void, (struct dm_task *dmt), \
|
---|
| 48 | (dmt))
|
---|
| 49 |
|
---|
| 50 | #ifdef VBOX_LIBDEVMAPPER_GENERATE_HEADER
|
---|
| 51 | # define RT_RUNTIME_LOADER_GENERATE_HEADER
|
---|
| 52 | # define RT_RUNTIME_LOADER_GENERATE_DECLS
|
---|
| 53 | # include <iprt/runtime-loader.h>
|
---|
| 54 | # undef RT_RUNTIME_LOADER_GENERATE_HEADER
|
---|
| 55 | # undef RT_RUNTIME_LOADER_GENERATE_DECLS
|
---|
| 56 |
|
---|
| 57 | #elif defined(VBOX_LIBDEVMAPPER_GENERATE_BODY)
|
---|
| 58 | # define RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
|
---|
| 59 | # include <iprt/runtime-loader.h>
|
---|
| 60 | # undef RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
|
---|
| 61 |
|
---|
| 62 | #else
|
---|
| 63 | # error This file should only be included to generate stubs for loading the libdevmapper library at runtime
|
---|
| 64 | #endif
|
---|
| 65 |
|
---|
| 66 | #undef RT_RUNTIME_LOADER_LIB_NAME
|
---|
| 67 | #undef RT_RUNTIME_LOADER_INSERT_SYMBOLS
|
---|
| 68 |
|
---|