From 0dd3edd27c78b903e4a667a0d18d8092cd653982 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Thu, 26 Nov 2020 15:48:38 +0100 Subject: #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": [...] } --- src/rest.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rest.c b/src/rest.c index 5045dc6..ae4c44d 100644 --- a/src/rest.c +++ b/src/rest.c @@ -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, ¶ms->type); + params->flags |= OG_REST_PARAM_TYPE; } else if (!strcmp(key, "disk")) { err = og_json_parse_string(value, ¶ms->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 | -- cgit v1.2.3-18-g5258