Добавил функцию сохранения устройств ввода вывода

pull/4/head
Igor Belitskiy 2 years ago
parent 2bf8a2949e
commit 5dc23e2a6f

3
.gitignore vendored

@ -4,4 +4,5 @@ ubl-settings-resourcequota_ru.po~
source/ubl-cmake.h source/ubl-cmake.h
ubl-settings-resourcequota ubl-settings-resourcequota
build/ build/
compile compile
vgcore.*

@ -992,6 +992,8 @@ char* save_format_value(int index) {
split_simvol[0] = ','; split_simvol[0] = ',';
split_simvol[1] = '\0'; split_simvol[1] = '\0';
} }
value = add_io_str_format_ubconfig(value, "IOReadBandwidthMax", main_config.i_o_limit_read, main_config.disk_read, index);
value = add_io_str_format_ubconfig(value, "IOWriteBandwidthMax", main_config.i_o_limit_write, main_config.disk_write, index);
//if (strstr(main_config.i_o_limit_read[index], "-") == NULL) { //if (strstr(main_config.i_o_limit_read[index], "-") == NULL) {
//value = yon_char_unite(value ,split_simvol, philos_format_cfg_str_size_memory("IOReadBandwidthMax", main_config.i_o_limit_read[index],main_config.i_o_limit_read_size[index]), NULL); //value = yon_char_unite(value ,split_simvol, philos_format_cfg_str_size_memory("IOReadBandwidthMax", main_config.i_o_limit_read[index],main_config.i_o_limit_read_size[index]), NULL);
// split_simvol[0] = ','; // split_simvol[0] = ',';
@ -1002,7 +1004,26 @@ char* save_format_value(int index) {
//} //}
return value; return value;
} }
char* add_io_str_format_ubconfig(char* cmd_io, char* key, char*** i_o_limit, char*** disk_read, int index) {
char split_simvol[2] = {0};
if (i_o_limit != NULL) {
if (i_o_limit[index] != NULL) {
if (i_o_limit[index] != NULL) {
for (int i = 0;i_o_limit[index][i] != NULL; i++) {
if (i==0) {
cmd_io = yon_char_unite(cmd_io, ",", key, "=");
}
char* read_limit = i_o_limit[index][i];
char* read_limit_disk = disk_read[index][i];
cmd_io = yon_char_unite(cmd_io, split_simvol, read_limit_disk, " ", read_limit);
split_simvol[0] = ',';
split_simvol[1] = '\0';
}
}
}
}
return cmd_io;
}
int check_save(dictionary* load_cfg) { int check_save(dictionary* load_cfg) {
if (main_config.flag_set_data == 1) { if (main_config.flag_set_data == 1) {

@ -218,4 +218,5 @@ char* template_format_str_remove_save(dictionary* load_cfg, char* source_remove_
char* template_format_str_set_save(dictionary* load_cfg, char* source_set_cmd); char* template_format_str_set_save(dictionary* load_cfg, char* source_set_cmd);
char* save_format_key(int index); char* save_format_key(int index);
void get_param_io_limit(char** arr_values, int index_start, int size, int index_n1, char *key_find); void get_param_io_limit(char** arr_values, int index_start, int size, int index_n1, char *key_find);
char* add_io_str_format_ubconfig(char* cmd_io, char* key, char*** i_o_limit, char*** disk_read, int index);
char* format_io_limit_in_tree_view(config_str* disk, config_str* i_o_limit, int** i_o_limit_size, int index); char* format_io_limit_in_tree_view(config_str* disk, config_str* i_o_limit, int** i_o_limit_size, int index);
Loading…
Cancel
Save