From fe2ce878622de3913620baee3cc27cc3745381bd Mon Sep 17 00:00:00 2001 From: lifeng68 Date: Sat, 5 Sep 2020 15:50:18 +0800 Subject: [PATCH] update: add support update blkio_weight Signed-off-by: lifeng68 --- src/cmd/isula/extend/update.c | 4 ++-- src/cmd/isula/extend/update.h | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/cmd/isula/extend/update.c b/src/cmd/isula/extend/update.c index 84240a1..50f411d 100644 --- a/src/cmd/isula/extend/update.c +++ b/src/cmd/isula/extend/update.c @@ -111,8 +111,8 @@ int cmd_update_main(int argc, const char **argv) int i = 0; struct isula_libutils_log_config lconf = { 0 }; command_t cmd; - struct command_option options[] = { LOG_OPTIONS(lconf) UPDATE_OPTIONS(g_cmd_update_args), - COMMON_OPTIONS(g_cmd_update_args) + struct command_option options[] = { LOG_OPTIONS(lconf) UPDATE_OPTIONS(g_cmd_update_args) + COMMON_OPTIONS(g_cmd_update_args) }; isula_libutils_default_log_config(argv[0], &lconf); diff --git a/src/cmd/isula/extend/update.h b/src/cmd/isula/extend/update.h index 361f10b..70dc0bb 100644 --- a/src/cmd/isula/extend/update.h +++ b/src/cmd/isula/extend/update.h @@ -79,10 +79,20 @@ extern "C" { &(cmdargs).cr.memory_swap, \ "Swap limit equal to memory plus swap: '-1' to enable unlimited swap", \ command_convert_memswapbytes }, \ - { \ - CMD_OPT_TYPE_STRING, false, "restart", 0, &(cmdargs).restart, \ - "Restart policy to apply when a container exits", NULL \ - } + { CMD_OPT_TYPE_STRING, \ + false, \ + "restart", \ + 0, \ + &(cmdargs).restart, \ + "Restart policy to apply when a container exits", \ + NULL }, \ + { CMD_OPT_TYPE_CALLBACK, \ + false, \ + "blkio-weight", \ + 0, \ + &(cmdargs).cr.blkio_weight, \ + "Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)", \ + command_convert_u16 }, extern const char g_cmd_update_desc[]; extern const char g_cmd_update_usage[]; -- GitLab