31 printf(
"Missing required field in request config '%s', exiting program\n", s);
38 char error_buffer[1024];
41 fp = fopen(name,
"r");
49 printf(
"Error parsing config: %s\n", error_buffer);
143 info.
ok ? ((unsigned) info.
u.
i) : 0xFFFFFFFFFFFFFFFF;
147 info.
ok ? ((unsigned) info.
u.
i) : 0xFFFFFFFFFFFFFFFF;
151 info.
ok ? info.
u.
i != 0 : 0;
155 info.
ok ? info.
u.
i != 0 : 0;
159 info.
ok ? info.
u.
i : 24;
163 info.
ok ? info.
u.
i : 100;
167 info.
ok ? info.
u.
i : 0x100;
171 info.
ok ? info.
u.
s :
"GVM GPU";
175 info.
ok ? info.
u.
s :
"Compute";
183 info.
ok ? info.
u.
i : 1;
188 info.
ok ? info.
u.
i : 1024;
193 info.
ok ? info.
u.
i : 1024;
198 info.
ok ? info.
u.
i : 120;
203 info.
ok ? info.
u.
i : 0;
struct GpuConfigs get_configs(const char *name)
Parses a config file.
static void failed_parse(const char *s)
Structure to handle GPU Configurations.
struct MDevRequest * requests
List of requested mdevs.
size_t mdev_size
How many requested mdevs are in the list of mdevs.
size_t gpu_size
How many gpus are in the list of gpus.
struct Gpu * gpus
List of gpus.
Structure to provide a list of GPU configurations.
size_t config_size
Size of the configuration list.
struct GpuConfig * configs
List of configurations.
uint32_t identifier
Identifier for the GPU.
uint32_t device_id
Device id for the PCI device.
uint32_t slot
Slot for the PCI device.
uint32_t sub_vendor_id
Sub vendor id for the PCI device.
uint32_t bus
Bus for the PCI device.
uint32_t sub_device_id
Sub device id for the PCI device.
uint32_t vendor_id
Vendor id for the PCI device.
uint32_t function
Function for the PCI device.
uint32_t domain
Domain for the PCI device.
Mediated Device Request Structure.
uint32_t map_vid_size
Mappable video size (IN MEGABYTES).
const char * name
Name of the GPU.
uint8_t ecc_support
If the Mediated GPU has ECC supported.
uint32_t bar1_len
Bar 1 Length.
uint8_t multi_mdev
If multiple mdevs supported.
uint32_t max_inst
Max number of mediated GPUs.
uint64_t v_dev_id
Virtual device id.
uint32_t fb_res
Frame buffer reserved (IN MEGABYTES).
uint64_t p_dev_id
Physical device id.
uint32_t fb_len
Frame buffer length (IN MEGABYTES).
uint32_t num
Number of the mdev.
const char * gpu_class
GPU Class structure.
struct VirtDisplay * disp
Virtual display structure.
uint32_t max_res_y
Max resolution Y.
uint32_t max_res_x
Max resolution X.
uint32_t num_heads
Number of monitor heads.
TOML_EXTERN toml_datum_t toml_int_in(const toml_table_t *arr, const char *key)
TOML_EXTERN void toml_free(toml_table_t *tab)
TOML_EXTERN toml_table_t * toml_parse_file(FILE *fp, char *errbuf, int errbufsz)
TOML_EXTERN toml_table_t * toml_table_at(const toml_array_t *arr, int idx)
TOML_EXTERN toml_datum_t toml_string_in(const toml_table_t *arr, const char *key)
TOML_EXTERN int toml_array_nelem(const toml_array_t *arr)
TOML_EXTERN toml_table_t * toml_table_in(const toml_table_t *tab, const char *key)
TOML_EXTERN toml_array_t * toml_array_in(const toml_table_t *tab, const char *key)
TOML_EXTERN toml_datum_t toml_bool_in(const toml_table_t *arr, const char *key)