[sheepdog] [PATCH] dog: fix a core dump by 'vdi lock force-unlock'

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Fri Aug 29 08:45:59 CEST 2014


At Thu, 28 Aug 2014 14:19:12 +0800,
Liu Yuan wrote:
> 
> force-unlock expect an argument so we need to set CMD_NEED_ARG for it otherwise
> a core will be generated by
> 
> $ dog vdi lock force-unlock # without argument
> 
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  dog/vdi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.
Hitoshi

> 
> diff --git a/dog/vdi.c b/dog/vdi.c
> index 19da73e..2b6a5cb 100644
> --- a/dog/vdi.c
> +++ b/dog/vdi.c
> @@ -2870,8 +2870,8 @@ static int lock_force_unlock(int argc, char **argv)
>  
>  static struct subcommand vdi_lock_cmd[] = {
>  	{"list", NULL, NULL, "list locked VDIs", NULL, 0, lock_list},
> -	{"force-unlock", "<vdiname>", NULL, "unlock locked VDI forcibly", NULL, 0,
> -	 lock_force_unlock},
> +	{"force-unlock", "<vdiname>", NULL, "unlock locked VDI forcibly", NULL,
> +	 CMD_NEED_ARG, lock_force_unlock},
>  	{NULL},
>  };
>  
> -- 
> 1.9.1
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list