GVM User Suite
User tools for the GVM open source project.
configs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 2666680 Ontario Inc.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  */
19 #ifndef UTILS_CONFIGS_H
20 #define UTILS_CONFIGS_H
21 
22 #include <gpu/mdev.h>
23 
24 #include <stdlib.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 struct GpuConfig {
35  struct Gpu* gpus;
36  size_t gpu_size;
38  size_t mdev_size;
39 };
40 
45 struct GpuConfigs {
46  struct GpuConfig* configs;
47  size_t config_size;
48 };
49 
57 struct GpuConfigs get_configs(const char* name);
58 
59 #ifdef __cplusplus
60 };
61 #endif
62 
63 #endif
struct GpuConfigs get_configs(const char *name)
Parses a config file.
Definition: configs.c:35
Structure to handle GPU Configurations.
Definition: configs.h:34
struct MDevRequest * requests
List of requested mdevs.
Definition: configs.h:37
size_t mdev_size
How many requested mdevs are in the list of mdevs.
Definition: configs.h:38
size_t gpu_size
How many gpus are in the list of gpus.
Definition: configs.h:36
struct Gpu * gpus
List of gpus.
Definition: configs.h:35
Structure to provide a list of GPU configurations.
Definition: configs.h:45
size_t config_size
Size of the configuration list.
Definition: configs.h:47
struct GpuConfig * configs
List of configurations.
Definition: configs.h:46
GPU Base Structure.
Definition: mdev.h:33
Mediated Device Request Structure.
Definition: mdev.h:62