From 60719bedbcbb05e7d0f6553b6ad9d51bf74bc155 Mon Sep 17 00:00:00 2001 From: Lin Ma Date: Fri, 11 Sep 2020 15:13:18 +0800 Subject: [PATCH] virsh: limit completion of checkpoint-{create, delete} to active domains Signed-off-by: Lin Ma Reviewed-by: Michal Privoznik --- tools/virsh-checkpoint.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index c4ff863802..33e70515ad 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -90,7 +90,7 @@ static const vshCmdInfo info_checkpoint_create[] = { }; static const vshCmdOptDef opts_checkpoint_create[] = { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name = "xmlfile", .type = VSH_OT_STRING, .help = N_("domain checkpoint XML") @@ -201,7 +201,7 @@ static const vshCmdInfo info_checkpoint_create_as[] = { }; static const vshCmdOptDef opts_checkpoint_create_as[] = { - VIRSH_COMMON_OPT_DOMAIN_FULL(0), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name = "name", .type = VSH_OT_STRING, .help = N_("name of checkpoint") @@ -1015,7 +1015,8 @@ static const vshCmdInfo info_checkpoint_delete[] = { }; static const vshCmdOptDef opts_checkpoint_delete[] = { - VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT), + VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT | + VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name = "checkpointname", .type = VSH_OT_STRING, .help = N_("checkpoint name"),