Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/zone_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ struct hv_pci_dev_config {
__u8 bus;
__u8 device;
__u8 function;
__u8 v_bus;
__u8 v_device;
__u8 v_function;
__u32 dev_type;
};

Expand Down
10 changes: 10 additions & 0 deletions tools/hvisor.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,12 @@ static int parse_pci_config(cJSON *root, zone_config_t *config) {
SAFE_CJSON_GET_OBJECT_ITEM(dev_config_json, "device");
cJSON *dev_function_json =
SAFE_CJSON_GET_OBJECT_ITEM(dev_config_json, "function");
cJSON *dev_vbus_json =
SAFE_CJSON_GET_OBJECT_ITEM(dev_config_json, "v_bus");
cJSON *dev_vdevice_json =
SAFE_CJSON_GET_OBJECT_ITEM(dev_config_json, "v_device");
cJSON *dev_vfunction_json =
SAFE_CJSON_GET_OBJECT_ITEM(dev_config_json, "v_function");
cJSON *dev_type_json =
SAFE_CJSON_GET_OBJECT_ITEM(dev_config_json, "dev_type");

Expand All @@ -629,6 +635,10 @@ static int parse_pci_config(cJSON *root, zone_config_t *config) {
parse_json_linux_u8(dev_device_json, &dev_config->device) != 0 ||
parse_json_linux_u8(dev_function_json, &dev_config->function) !=
0 ||
parse_json_linux_u8(dev_vbus_json, &dev_config->v_bus) != 0 ||
parse_json_linux_u8(dev_vdevice_json, &dev_config->v_device) != 0 ||
parse_json_linux_u8(dev_vfunction_json, &dev_config->v_function) !=
0 ||
parse_json_linux_u32(dev_type_json, &dev_config->dev_type) != 0) {
log_error("Failed to parse pci device config\n");
goto err_out;
Expand Down
Loading