diff --git a/tools/virsh.c b/tools/virsh.c index f96ee040df..9a189fddbf 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -11915,12 +11915,15 @@ vshCmddefGetInfo(const vshCmdDef * cmd, const char *name) } static int -vshCmddefOptParse(const vshCmdDef *cmd, uint32_t* opts_need_arg, +vshCmddefOptParse(const vshCmdDef *cmd, uint32_t *opts_need_arg, uint32_t *opts_required) { int i; bool optional = false; + *opts_need_arg = 0; + *opts_required = 0; + if (!cmd->opts) return 0;