#1008 Add support to work with GPT tables

ogServer /setup do not support to indicate which table type the user
want to use. It always supposes that the partition table is MBR/MSDOS.

Add ogServer support to work with GPT tables. Add new field table type
to /setup that expects a string with "MSDOS" or "GPT".

Example old JSON:
{
  "clients": [...],
  "disk": "1",
  "cache": "0",
  "cache_size": "0",
  "partition_setup": [...]
}

Example new JSON:
{
  "clients": [...],
  "type": "GPT",
  "disk": "1",
  "cache": "0",
  "cache_size": "0",
  "partition_setup": [...]
}
master
Javier Sánchez Parra 2020-11-26 15:48:38 +01:00 committed by OpenGnSys Support Team
parent 24e6fbf1de
commit 0dd3edd27c
1 changed files with 4 additions and 0 deletions

View File

@ -2075,6 +2075,9 @@ static int og_cmd_setup(json_t *element, struct og_msg_params *params)
json_object_foreach(element, key, value) {
if (!strcmp(key, "clients")) {
err = og_json_parse_clients(value, params);
} else if (!strcmp(key, "type")) {
err = og_json_parse_string(value, &params->type);
params->flags |= OG_REST_PARAM_TYPE;
} else if (!strcmp(key, "disk")) {
err = og_json_parse_string(value, &params->disk);
params->flags |= OG_REST_PARAM_DISK;
@ -2093,6 +2096,7 @@ static int og_cmd_setup(json_t *element, struct og_msg_params *params)
}
if (!og_msg_params_validate(params, OG_REST_PARAM_ADDR |
OG_REST_PARAM_TYPE |
OG_REST_PARAM_DISK |
OG_REST_PARAM_CACHE |
OG_REST_PARAM_CACHE_SIZE |